diff --git a/src/Socket/messages-recv.ts b/src/Socket/messages-recv.ts index d56d5aa1..e0e17681 100644 --- a/src/Socket/messages-recv.ts +++ b/src/Socket/messages-recv.ts @@ -1267,7 +1267,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => { } } - cleanMessage(msg, authState.creds.me!.id) + cleanMessage(msg, authState.creds.me!.id, authState.creds.me!.lid!) await upsertMessage(msg, node.attrs.offline ? 'append' : 'notify') }) diff --git a/src/Utils/process-message.ts b/src/Utils/process-message.ts index df1759e3..89a1677a 100644 --- a/src/Utils/process-message.ts +++ b/src/Utils/process-message.ts @@ -53,7 +53,7 @@ const REAL_MSG_STUB_TYPES = new Set([ const REAL_MSG_REQ_ME_STUB_TYPES = new Set([WAMessageStubType.GROUP_PARTICIPANT_ADD]) /** Cleans a received message to further processing */ -export const cleanMessage = (message: WAMessage, meId: string) => { +export const cleanMessage = (message: WAMessage, meId: string, meLid: string) => { // ensure remoteJid and participant doesn't have device or agent in it if (isHostedPnUser(message.key.remoteJid!) || isHostedLidUser(message.key.remoteJid!)) { message.key.remoteJid = jidEncode( @@ -90,7 +90,7 @@ export const cleanMessage = (message: WAMessage, meId: string) => { // if the sender believed the message being reacted to is not from them // we've to correct the key to be from them, or some other participant msgKey.fromMe = !msgKey.fromMe - ? areJidsSameUser(msgKey.participant || msgKey.remoteJid!, meId) + ? areJidsSameUser(msgKey.participant || msgKey.remoteJid!, meId) || areJidsSameUser(msgKey.participant || msgKey.remoteJid!, meLid) : // if the message being reacted to, was from them // fromMe automatically becomes false false