mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
usync: add lid protocol
This commit is contained in:
25
src/WAUSync/Protocols/UsyncLIDProtocol.ts
Normal file
25
src/WAUSync/Protocols/UsyncLIDProtocol.ts
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -108,4 +108,8 @@ export class USyncQuery {
|
|||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
withLIDProtocol() {
|
||||||
|
this.protocols.push(new USyncLIDProtocol())
|
||||||
|
return this
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user