UNPKG

@radzztnzx/rbail

Version:

Pro Bails based by Whiskeysockets, Modified by RadzzOffc

29 lines 753 B
import { assertNodeErrorFree } from '../../WABinary/index.js'; import { USyncUser } from '../USyncUser.js'; export class USyncContactProtocol { constructor() { this.name = 'contact'; } getQueryElement() { return { tag: 'contact', attrs: {} }; } getUserElement(user) { //TODO: Implement type / username fields (not yet supported) return { tag: 'contact', attrs: {}, content: user.phone }; } parser(node) { if (node.tag === 'contact') { assertNodeErrorFree(node); return node?.attrs?.type === 'in'; } return false; } } //# sourceMappingURL=USyncContactProtocol.js.map