contact upsert fix

This commit is contained in:
Adhiraj Singh
2021-08-20 17:05:58 +05:30
parent 3a914d6987
commit b0909c03eb

View File

@@ -229,10 +229,9 @@ const makeChatsSocket = (config: SocketConfig) => {
} }
}) })
socketEvents.on ('CB:action,,user', json => { socketEvents.on('CB:action,,user', (json: BinaryNode) => {
const node = json[2][0] if(Array.isArray(json.data)) {
if (node) { const user = json.data[0].attributes as any as Contact
const user = node[1] as Contact
user.jid = whatsappID(user.jid) user.jid = whatsappID(user.jid)
ev.emit('contacts.upsert', [user]) ev.emit('contacts.upsert', [user])