29 lines
753 B
JavaScript
29 lines
753 B
JavaScript
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
|