usync: add lid protocol

This commit is contained in:
Rajeh Taher
2025-04-09 20:16:51 +03:00
parent 1ab7f9b561
commit 642bfd825a
2 changed files with 29 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
import { USyncQueryProtocol } from '../../Types/USync'
import { BinaryNode } from '../../WABinary'
export class USyncLIDProtocol implements USyncQueryProtocol {
name = 'lid'
getQueryElement(): BinaryNode {
return {
tag: 'lid',
attrs: {},
}
}
getUserElement(): null {
return null
}
parser(node: BinaryNode): string | null {
if(node.tag === 'lid') {
return node.attrs.val
}
return null
}
}

View File

@@ -108,4 +108,8 @@ export class USyncQuery {
return this
}
withLIDProtocol() {
this.protocols.push(new USyncLIDProtocol())
return this
}
}