whatsapp-store-db 1.3.60 → 1.3.62
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.
package/package.json
CHANGED
|
@@ -32,15 +32,42 @@ index f2e2e10..47e1dfd 100644
|
|
|
32
32
|
}
|
|
33
33
|
const errorMessage = msg?.messageStubParameters?.[0] || '';
|
|
34
34
|
diff --git a/node_modules/baileys/lib/Utils/process-message.js b/node_modules/baileys/lib/Utils/process-message.js
|
|
35
|
-
index 7927483..
|
|
35
|
+
index 7927483..b0a94db 100644
|
|
36
36
|
--- a/node_modules/baileys/lib/Utils/process-message.js
|
|
37
37
|
+++ b/node_modules/baileys/lib/Utils/process-message.js
|
|
38
|
-
@@ -223,8 +223,
|
|
38
|
+
@@ -223,8 +223,46 @@ const processMessage = async (message, { shouldProcessHistoryMsg, placeholderRes
|
|
39
39
|
//eslint-disable-next-line max-depth
|
|
40
40
|
if (retryResponse) {
|
|
41
41
|
const webMessageInfo = proto.WebMessageInfo.decode(retryResponse.webMessageInfoBytes);
|
|
42
42
|
- // wait till another upsert event is available, don't want it to be part of the PDO response message
|
|
43
43
|
- // TODO: parse through proper message handling utilities (to add relevant key fields)
|
|
44
|
+
+ if (webMessageInfo.key?.remoteJid) {
|
|
45
|
+
+ const rawJid = webMessageInfo.key.remoteJid;
|
|
46
|
+
+ if (isLidUser(rawJid)) {
|
|
47
|
+
+ try {
|
|
48
|
+
+ const pn = await signalRepository.lidMapping.getPNForLID(rawJid);
|
|
49
|
+
+ if (pn) {
|
|
50
|
+
+ const phoneJid = jidNormalizedUser(pn.includes('@') ? pn : `${pn}@s.whatsapp.net`);
|
|
51
|
+
+ logger.error({ session: meId, lid: rawJid, resolved: phoneJid }, 'CTWA: Resolved LID to phone number for recovered message');
|
|
52
|
+
+ webMessageInfo.key.remoteJidAlt = rawJid;
|
|
53
|
+
+ webMessageInfo.key.remoteJid = phoneJid;
|
|
54
|
+
+ }
|
|
55
|
+
+ else {
|
|
56
|
+
+ logger.error({ session: meId, lid: rawJid }, 'CTWA: Could not resolve LID to phone number - no mapping found');
|
|
57
|
+
+ }
|
|
58
|
+
+ }
|
|
59
|
+
+ catch (e) {
|
|
60
|
+
+ logger.error({ session: meId, lid: rawJid, error: e }, 'CTWA: Error resolving LID to phone number');
|
|
61
|
+
+ }
|
|
62
|
+
+ }
|
|
63
|
+
+ else {
|
|
64
|
+
+ const normalized = jidNormalizedUser(rawJid);
|
|
65
|
+
+ if (normalized !== rawJid) {
|
|
66
|
+
+ logger.error({ session: meId, rawJid, normalized }, 'CTWA: Normalized remoteJid (stripped device suffix)');
|
|
67
|
+
+ webMessageInfo.key.remoteJid = normalized;
|
|
68
|
+
+ }
|
|
69
|
+
+ }
|
|
70
|
+
+ }
|
|
44
71
|
+ const recoveredContent = webMessageInfo.message?.conversation
|
|
45
72
|
+ || webMessageInfo.message?.extendedTextMessage?.text
|
|
46
73
|
+ || webMessageInfo.message?.imageMessage?.caption
|