fix fromMe on receipts and messages, missing notifications !

This commit is contained in:
Rajeh Taher
2023-10-01 14:56:09 +00:00
parent ef8d1a09fb
commit c1fa5a13c3
2 changed files with 3 additions and 2 deletions

View File

@@ -532,7 +532,8 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
const handleReceipt = async(node: BinaryNode) => {
const { attrs, content } = node
const isNodeFromMe = areJidsSameUser(attrs.participant || attrs.from, authState.creds.me?.id)
const isLid = attrs.from.includes('lid')
const isNodeFromMe = areJidsSameUser(attrs.participant || attrs.from, isLid ? authState.creds.me?.lid : authState.creds.me?.id)
const remoteJid = !isNodeFromMe || isJidGroup(attrs.from) ? attrs.from : attrs.recipient
const fromMe = !attrs.recipient || (attrs.type === 'retry' && isNodeFromMe)

View File

@@ -82,7 +82,7 @@ export function decodeMessageNode(
throw new Boom('Unknown message type', { data: stanza })
}
const fromMe = isMe(stanza.attrs.participant || stanza.attrs.from)
const fromMe = (isLidUser(from) ? isMeLid : isMe)(stanza.attrs.participant || stanza.attrs.from)
const pushname = stanza.attrs.notify
const key: WAMessageKey = {