whalibmob 5.5.77 → 5.5.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -717,14 +717,29 @@ class MessageSender {
|
|
|
717
717
|
// started being decoded at all)
|
|
718
718
|
// lid — always address the LID when one is known (the default below)
|
|
719
719
|
// auto — same as lid; the default
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
const
|
|
723
|
-
const
|
|
720
|
+
// Baileys 7.0.0-rc13 — the release that fixed ack 479 on LID addressing —
|
|
721
|
+
// keeps the stanza addressed to the JID the caller passed:
|
|
722
|
+
// const finalJid = jid;
|
|
723
|
+
// const destinationJid = !isStatus ? finalJid : statusJid;
|
|
724
|
+
// It never rewrites `to` to the LID. The LID is used only to look up
|
|
725
|
+
// devices, fetch prekeys and address the per-device <to> entries; the
|
|
726
|
+
// envelope stays on the phone JID. Rewriting the envelope is what draws
|
|
727
|
+
// 479, which both whatsmeow #859 and the Baileys LID reports describe as
|
|
728
|
+
// appearing specifically when the message is addressed to an @lid.
|
|
729
|
+
//
|
|
730
|
+
// WA_DM_ROUTE=lid restores the old envelope-on-LID behaviour for
|
|
731
|
+
// comparison; anything else keeps the Baileys shape.
|
|
732
|
+
const routeMode = (process.env.WA_DM_ROUTE || 'auto').toLowerCase();
|
|
733
|
+
const lidUser = this._client._pnToLid && this._client._pnToLid.get(recipientPhone);
|
|
734
|
+
// Participants still come from the LID device list whenever we know it —
|
|
735
|
+
// that part matches Baileys too, which encodes @lid per-device JIDs while
|
|
736
|
+
// leaving the envelope alone.
|
|
737
|
+
const useLidRoute = !!lidUser;
|
|
738
|
+
const routingToJid = (lidUser && routeMode === 'lid') ? `${lidUser}@lid` : toJid;
|
|
724
739
|
|
|
725
740
|
_whaDbg('[DBG] DM_ROUTE phone=' + recipientPhone +
|
|
726
|
-
'
|
|
727
|
-
' mode=' + routeMode);
|
|
741
|
+
' envelope=' + routingToJid + ' participants=' +
|
|
742
|
+
(useLidRoute ? 'LID' : 'PN') + ' mode=' + routeMode);
|
|
728
743
|
|
|
729
744
|
let otherJids;
|
|
730
745
|
// Follow the same address family as the routing JID — the participants and
|