Merge branch 'WhiskeySockets:master' into master

This commit is contained in:
Samuel Scheit
2023-05-31 18:12:43 +02:00
committed by GitHub
7 changed files with 7787 additions and 186 deletions

View File

@@ -167,22 +167,17 @@ export const makeChatsSocket = (config: SocketConfig) => {
}
const onWhatsApp = async(...jids: string[]) => {
const results = await interactiveQuery(
[
{
tag: 'user',
attrs: {},
content: jids.map(
jid => ({
tag: 'contact',
attrs: {},
content: `+${jid}`
})
)
}
],
{ tag: 'contact', attrs: {} }
)
const query = { tag: 'contact', attrs: {} }
const list = jids.map((jid) => ({
tag: 'user',
attrs: {},
content: [{
tag: 'contact',
attrs: {},
content: jid,
}],
}))
const results = await interactiveQuery(list, query)
return results.map(user => {
const contact = getBinaryNodeChild(user, 'contact')