amiudmodz 5.0.4 → 5.0.5
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.
|
@@ -856,6 +856,10 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
856
856
|
if (!(0, WABinary_1.isJidGroup)(msg.key.remoteJid) && (0, WABinary_1.isLidUser)(msg.key.remoteJid)) {
|
|
857
857
|
msg.key.remoteJid = node.attrs.sender_pn || node.attrs.peer_recipient_pn;
|
|
858
858
|
}
|
|
859
|
+
|
|
860
|
+
if (msg.key.fromMe && (0, WABinary_1.isJidUser)(msg.key.remoteJid) && node.attrs.recipient && (0, WABinary_1.isJidGroup)(node.attrs.recipient)) {
|
|
861
|
+
msg.key.remoteJid = node.attrs.recipient;
|
|
862
|
+
}
|
|
859
863
|
let participant = msg.key.participant;
|
|
860
864
|
if (category === 'peer') {
|
|
861
865
|
type = 'peer_msg';
|
|
@@ -485,7 +485,14 @@ const makeMessagesSocket = (config) => {
|
|
|
485
485
|
logger.debug({ msgId }, `sending message to ${participants.length} devices`);
|
|
486
486
|
await sendNode(stanza);
|
|
487
487
|
});
|
|
488
|
-
return
|
|
488
|
+
return {
|
|
489
|
+
key: {
|
|
490
|
+
remoteJid: jid,
|
|
491
|
+
fromMe: true,
|
|
492
|
+
id: msgId,
|
|
493
|
+
participant: isGroup ? meId : undefined
|
|
494
|
+
}
|
|
495
|
+
}
|
|
489
496
|
};
|
|
490
497
|
const getTypeMessage = (msg) => {
|
|
491
498
|
const message = Utils_1.normalizeMessageContent(msg);
|
|
@@ -27,11 +27,12 @@ function decodeMessageNode(stanza, meId, meLid) {
|
|
|
27
27
|
throw new boom_1.Boom('receipient present, but msg not from me', { data: stanza });
|
|
28
28
|
}
|
|
29
29
|
chatId = recipient;
|
|
30
|
+
msgType = (0, WABinary_1.isJidGroup)(chatId) ? 'group' : (0, WABinary_1.isJidBroadcast)(chatId) ? 'broadcast' : (0, WABinary_1.isJidNewsLetter)(chatId) ? 'newsletter' : 'chat';
|
|
30
31
|
}
|
|
31
32
|
else {
|
|
32
33
|
chatId = from;
|
|
34
|
+
msgType = 'chat';
|
|
33
35
|
}
|
|
34
|
-
msgType = 'chat';
|
|
35
36
|
author = from;
|
|
36
37
|
}
|
|
37
38
|
else if ((0, WABinary_1.isLidUser)(from)) {
|
|
@@ -40,11 +41,12 @@ function decodeMessageNode(stanza, meId, meLid) {
|
|
|
40
41
|
throw new boom_1.Boom('receipient present, but msg not from me', { data: stanza });
|
|
41
42
|
}
|
|
42
43
|
chatId = recipient;
|
|
44
|
+
msgType = (0, WABinary_1.isJidGroup)(chatId) ? 'group' : (0, WABinary_1.isJidBroadcast)(chatId) ? 'broadcast' : (0, WABinary_1.isJidNewsLetter)(chatId) ? 'newsletter' : 'chat';
|
|
43
45
|
}
|
|
44
46
|
else {
|
|
45
47
|
chatId = from;
|
|
48
|
+
msgType = 'chat';
|
|
46
49
|
}
|
|
47
|
-
msgType = 'chat';
|
|
48
50
|
author = from;
|
|
49
51
|
}
|
|
50
52
|
else if ((0, WABinary_1.isJidGroup)(from)) {
|