socket: include lid in onWhatsApp response

This commit is contained in:
Rajeh Taher
2025-04-09 20:17:04 +03:00
parent 642bfd825a
commit c037f68c2d

View File

@@ -179,6 +179,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
const onWhatsApp = async(...jids: string[]) => { const onWhatsApp = async(...jids: string[]) => {
const usyncQuery = new USyncQuery() const usyncQuery = new USyncQuery()
.withContactProtocol() .withContactProtocol()
.withLIDProtocol()
for(const jid of jids) { for(const jid of jids) {
const phone = `+${jid.replace('+', '').split('@')[0].split(':')[0]}` const phone = `+${jid.replace('+', '').split('@')[0].split(':')[0]}`
@@ -188,7 +189,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
const results = await sock.executeUSyncQuery(usyncQuery) const results = await sock.executeUSyncQuery(usyncQuery)
if(results) { if(results) {
return results.list.filter((a) => !!a.contact).map(({ contact, id }) => ({ jid: id, exists: contact })) return results.list.filter((a) => !!a.contact).map(({ contact, id, lid }) => ({ jid: id, exists: contact, lid }))
} }
} }