From f032c9b0eaef4a84f385cc1aedf955c2c09a167e Mon Sep 17 00:00:00 2001 From: Renato Alcara Date: Sun, 1 Mar 2026 08:46:09 -0300 Subject: [PATCH] fix: normalise remoteJid in reaction/poll keys for fromMe messages (#240) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In DMs, when the connected user sends a reaction, the inner key's remoteJid could remain unnormalized (e.g. LID vs PN), preventing correct matching with the original message. Also normalises participant in groups for own messages — an improvement over upstream Baileys#2386. --- src/Utils/process-message.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Utils/process-message.ts b/src/Utils/process-message.ts index 33b4580a..d369bd69 100644 --- a/src/Utils/process-message.ts +++ b/src/Utils/process-message.ts @@ -113,6 +113,14 @@ export const cleanMessage = (message: WAMessage, meId: string, meLid: string) => msgKey.remoteJid = message.key.remoteJid // set participant of the message msgKey.participant = msgKey.participant || message.key.participant + } else { + // fromMe reactions/polls: normalise remoteJid to match the chat JID + // ensures DM reaction keys are consistent with group behavior + msgKey.remoteJid = message.key.remoteJid + // in groups, normalise participant for own messages too + if (message.key.participant) { + msgKey.participant = msgKey.participant || message.key.participant + } } } }