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
This commit is contained in:
M Ilham Ari Fahmi
2025-09-14 21:05:48 +07:00
committed by GitHub
parent 421ca2eb92
commit c8ebdb9a0b
+1 -1
View File
@@ -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