From c8ebdb9a0bfbb1b882459e62cf21280b3584ea2f Mon Sep 17 00:00:00 2001 From: M Ilham Ari Fahmi Date: Sun, 14 Sep 2025 21:05:48 +0700 Subject: [PATCH] fix: fallback addressing_mode detection by sender suffix (#1776) * fix: fallback addressing_mode detection by sender suffix This commit is required because `remoteJidAlt` was not appearing. The issue happened since `addressing_mode` always defaulted to 'pn' when the ID was not a group, so the 'lid' path was never taken. * lint fix --- src/Utils/decode-wa-message.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Utils/decode-wa-message.ts b/src/Utils/decode-wa-message.ts index 6e0b3082..2c7c1417 100644 --- a/src/Utils/decode-wa-message.ts +++ b/src/Utils/decode-wa-message.ts @@ -79,11 +79,11 @@ type MessageType = | 'newsletter' export const extractAddressingContext = (stanza: BinaryNode) => { - const addressingMode = stanza.attrs.addressing_mode || 'pn' let senderAlt: string | undefined let recipientAlt: string | undefined const sender = stanza.attrs.participant || stanza.attrs.from + const addressingMode = stanza.attrs.addressing_mode || (sender?.endsWith('lid') ? 'lid' : 'pn') if (addressingMode === 'lid') { // Message is LID-addressed: sender is LID, extract corresponding PN