feat: add group suport in api session

gertec
adriano 2024-06-13 17:53:07 -03:00
parent 1c93c16f84
commit b9f8bfc8d5
1 changed files with 6 additions and 2 deletions

View File

@ -885,11 +885,15 @@ async function handleMessage(msg) {
if (msg.fromMe) { if (msg.fromMe) {
console.log('MSG FROM ME')
msgContact = await client.getContactById(msg.to) msgContact = await client.getContactById(msg.to)
} }
else { else {
console.log('MSG FROM CLIENT')
console.log('################# RECEIVING MESSAGE FROM: ', msg.from, ' to ', msg.to) console.log('################# RECEIVING MESSAGE FROM: ', msg.from, ' to ', msg.to)
msgContact = await msg.getContact() msgContact = await msg.getContact()
@ -912,10 +916,10 @@ async function handleMessage(msg) {
msgContact: msgContact, msgContact: msgContact,
chat: chat, chat: chat,
quotedMsg: quotedMsg ? quotedMsg.id.id : null, quotedMsg: quotedMsg ? quotedMsg.id.id : null,
media: media media: media,
getContactById: msg.fromMe ? await client.getContactById(msg.to) : await client.getContactById(msg.from)
} }
socketIo.emit("message_create", data) socketIo.emit("message_create", data)
} }