UNPKG

@faouzkk/baileys

Version:

A WebSockets library for interacting with WhatsApp Web

32 lines 869 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.USyncContactProtocol = void 0; const WABinary_1 = require("../../WABinary"); 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') { (0, WABinary_1.assertNodeErrorFree)(node); return node?.attrs?.type === 'in'; } return false; } } exports.USyncContactProtocol = USyncContactProtocol; //# sourceMappingURL=USyncContactProtocol.js.map