@d0v3riz/baileys 6.7.22 → 6.7.23
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/WAProto/GenerateStatics.sh +3 -2
- package/WAProto/fix-imports.js +29 -0
- package/WAProto/index.js +4136 -4138
- package/lib/Defaults/index.d.ts +3 -2
- package/lib/Defaults/index.d.ts.map +1 -0
- package/lib/Defaults/index.js +36 -40
- package/lib/Defaults/index.js.map +1 -0
- package/lib/Signal/Group/ciphertext-message.d.ts +1 -0
- package/lib/Signal/Group/ciphertext-message.d.ts.map +1 -0
- package/lib/Signal/Group/ciphertext-message.js +2 -5
- package/lib/Signal/Group/ciphertext-message.js.map +1 -0
- package/lib/Signal/Group/group-session-builder.d.ts +4 -3
- package/lib/Signal/Group/group-session-builder.d.ts.map +1 -0
- package/lib/Signal/Group/group-session-builder.js +7 -41
- package/lib/Signal/Group/group-session-builder.js.map +1 -0
- package/lib/Signal/Group/group_cipher.d.ts +3 -2
- package/lib/Signal/Group/group_cipher.d.ts.map +1 -0
- package/lib/Signal/Group/group_cipher.js +14 -16
- package/lib/Signal/Group/group_cipher.js.map +1 -0
- package/lib/Signal/Group/index.d.ts +12 -11
- package/lib/Signal/Group/index.d.ts.map +1 -0
- package/lib/Signal/Group/index.js +12 -57
- package/lib/Signal/Group/index.js.map +1 -0
- package/lib/Signal/Group/keyhelper.d.ts +2 -1
- package/lib/Signal/Group/keyhelper.d.ts.map +1 -0
- package/lib/Signal/Group/keyhelper.js +8 -44
- package/lib/Signal/Group/keyhelper.js.map +1 -0
- package/lib/Signal/Group/queue-job.d.ts +2 -0
- package/lib/Signal/Group/queue-job.d.ts.map +1 -0
- package/lib/Signal/Group/queue-job.js +5 -5
- package/lib/Signal/Group/queue-job.js.map +1 -0
- package/lib/Signal/Group/sender-chain-key.d.ts +2 -1
- package/lib/Signal/Group/sender-chain-key.d.ts.map +1 -0
- package/lib/Signal/Group/sender-chain-key.js +7 -9
- package/lib/Signal/Group/sender-chain-key.js.map +1 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +2 -1
- package/lib/Signal/Group/sender-key-distribution-message.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +6 -9
- package/lib/Signal/Group/sender-key-distribution-message.js.map +1 -0
- package/lib/Signal/Group/sender-key-message.d.ts +2 -1
- package/lib/Signal/Group/sender-key-message.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-message.js +10 -12
- package/lib/Signal/Group/sender-key-message.js.map +1 -0
- package/lib/Signal/Group/sender-key-name.d.ts +1 -0
- package/lib/Signal/Group/sender-key-name.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-name.js +2 -5
- package/lib/Signal/Group/sender-key-name.js.map +1 -0
- package/lib/Signal/Group/sender-key-record.d.ts +2 -1
- package/lib/Signal/Group/sender-key-record.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-record.js +9 -12
- package/lib/Signal/Group/sender-key-record.js.map +1 -0
- package/lib/Signal/Group/sender-key-state.d.ts +3 -2
- package/lib/Signal/Group/sender-key-state.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-state.js +6 -9
- package/lib/Signal/Group/sender-key-state.js.map +1 -0
- package/lib/Signal/Group/sender-message-key.d.ts +1 -0
- package/lib/Signal/Group/sender-message-key.d.ts.map +1 -0
- package/lib/Signal/Group/sender-message-key.js +5 -7
- package/lib/Signal/Group/sender-message-key.js.map +1 -0
- package/lib/Signal/libsignal.d.ts +3 -2
- package/lib/Signal/libsignal.d.ts.map +1 -0
- package/lib/Signal/libsignal.js +22 -55
- package/lib/Signal/libsignal.js.map +1 -0
- package/lib/Socket/Client/index.d.ts +3 -2
- package/lib/Socket/Client/index.d.ts.map +1 -0
- package/lib/Socket/Client/index.js +3 -18
- package/lib/Socket/Client/index.js.map +1 -0
- package/lib/Socket/Client/types.d.ts +2 -1
- package/lib/Socket/Client/types.d.ts.map +1 -0
- package/lib/Socket/Client/types.js +4 -6
- package/lib/Socket/Client/types.js.map +1 -0
- package/lib/Socket/Client/websocket.d.ts +2 -1
- package/lib/Socket/Client/websocket.d.ts.map +1 -0
- package/lib/Socket/Client/websocket.js +14 -26
- package/lib/Socket/Client/websocket.js.map +1 -0
- package/lib/Socket/business.d.ts +66 -64
- package/lib/Socket/business.d.ts.map +1 -0
- package/lib/Socket/business.js +32 -37
- package/lib/Socket/business.js.map +1 -0
- package/lib/Socket/chats.d.ts +21 -19
- package/lib/Socket/chats.d.ts.map +1 -0
- package/lib/Socket/chats.js +176 -141
- package/lib/Socket/chats.js.map +1 -0
- package/lib/Socket/communities.d.ts +219 -0
- package/lib/Socket/communities.d.ts.map +1 -0
- package/lib/Socket/communities.js +351 -0
- package/lib/Socket/communities.js.map +1 -0
- package/lib/Socket/groups.d.ts +37 -35
- package/lib/Socket/groups.d.ts.map +1 -0
- package/lib/Socket/groups.js +56 -63
- package/lib/Socket/groups.js.map +1 -0
- package/lib/Socket/index.d.ts +102 -70
- package/lib/Socket/index.d.ts.map +1 -0
- package/lib/Socket/index.js +16 -9
- package/lib/Socket/index.js.map +1 -0
- package/lib/Socket/messages-recv.d.ts +51 -49
- package/lib/Socket/messages-recv.d.ts.map +1 -0
- package/lib/Socket/messages-recv.js +180 -173
- package/lib/Socket/messages-recv.js.map +1 -0
- package/lib/Socket/messages-send.d.ts +48 -46
- package/lib/Socket/messages-send.d.ts.map +1 -0
- package/lib/Socket/messages-send.js +75 -84
- package/lib/Socket/messages-send.js.map +1 -0
- package/lib/Socket/mex.d.ts +2 -1
- package/lib/Socket/mex.d.ts.map +1 -0
- package/lib/Socket/mex.js +12 -16
- package/lib/Socket/mex.js.map +1 -0
- package/lib/Socket/newsletter.d.ts +46 -44
- package/lib/Socket/newsletter.d.ts.map +1 -0
- package/lib/Socket/newsletter.js +23 -27
- package/lib/Socket/newsletter.js.map +1 -0
- package/lib/Socket/socket.d.ts +13 -12
- package/lib/Socket/socket.d.ts.map +1 -0
- package/lib/Socket/socket.js +135 -115
- package/lib/Socket/socket.js.map +1 -0
- package/lib/Socket/usync.d.ts +15 -14
- package/lib/Socket/usync.d.ts.map +1 -0
- package/lib/Socket/usync.js +9 -11
- package/lib/Socket/usync.js.map +1 -0
- package/lib/Types/Auth.d.ts +4 -3
- package/lib/Types/Auth.d.ts.map +1 -0
- package/lib/Types/Auth.js +2 -2
- package/lib/Types/Auth.js.map +1 -0
- package/lib/Types/Call.d.ts +1 -0
- package/lib/Types/Call.d.ts.map +1 -0
- package/lib/Types/Call.js +2 -2
- package/lib/Types/Call.js.map +1 -0
- package/lib/Types/Chat.d.ts +10 -7
- package/lib/Types/Chat.d.ts.map +1 -0
- package/lib/Types/Chat.js +2 -4
- package/lib/Types/Chat.js.map +1 -0
- package/lib/Types/Contact.d.ts +1 -0
- package/lib/Types/Contact.d.ts.map +1 -0
- package/lib/Types/Contact.js +2 -2
- package/lib/Types/Contact.js.map +1 -0
- package/lib/Types/Events.d.ts +11 -10
- package/lib/Types/Events.d.ts.map +1 -0
- package/lib/Types/Events.js +2 -2
- package/lib/Types/Events.js.map +1 -0
- package/lib/Types/GroupMetadata.d.ts +3 -2
- package/lib/Types/GroupMetadata.d.ts.map +1 -0
- package/lib/Types/GroupMetadata.js +2 -2
- package/lib/Types/GroupMetadata.js.map +1 -0
- package/lib/Types/Label.d.ts +1 -0
- package/lib/Types/Label.d.ts.map +1 -0
- package/lib/Types/Label.js +3 -5
- package/lib/Types/Label.js.map +1 -0
- package/lib/Types/LabelAssociation.d.ts +1 -0
- package/lib/Types/LabelAssociation.d.ts.map +1 -0
- package/lib/Types/LabelAssociation.js +3 -5
- package/lib/Types/LabelAssociation.js.map +1 -0
- package/lib/Types/Message.d.ts +9 -7
- package/lib/Types/Message.d.ts.map +1 -0
- package/lib/Types/Message.js +7 -7
- package/lib/Types/Message.js.map +1 -0
- package/lib/Types/Newsletter.d.ts +1 -0
- package/lib/Types/Newsletter.d.ts.map +1 -0
- package/lib/Types/Newsletter.js +5 -7
- package/lib/Types/Newsletter.js.map +1 -0
- package/lib/Types/Product.d.ts +2 -1
- package/lib/Types/Product.d.ts.map +1 -0
- package/lib/Types/Product.js +2 -2
- package/lib/Types/Product.js.map +1 -0
- package/lib/Types/Signal.d.ts +2 -1
- package/lib/Types/Signal.d.ts.map +1 -0
- package/lib/Types/Signal.js +2 -2
- package/lib/Types/Signal.js.map +1 -0
- package/lib/Types/Socket.d.ts +8 -7
- package/lib/Types/Socket.d.ts.map +1 -0
- package/lib/Types/Socket.js +3 -2
- package/lib/Types/Socket.js.map +1 -0
- package/lib/Types/State.d.ts +14 -2
- package/lib/Types/State.d.ts.map +1 -0
- package/lib/Types/State.js +13 -2
- package/lib/Types/State.js.map +1 -0
- package/lib/Types/USync.d.ts +3 -2
- package/lib/Types/USync.d.ts.map +1 -0
- package/lib/Types/USync.js +2 -2
- package/lib/Types/USync.js.map +1 -0
- package/lib/Types/index.d.ts +15 -14
- package/lib/Types/index.d.ts.map +1 -0
- package/lib/Types/index.js +15 -31
- package/lib/Types/index.js.map +1 -0
- package/lib/Utils/auth-utils.d.ts +3 -2
- package/lib/Utils/auth-utils.d.ts.map +1 -0
- package/lib/Utils/auth-utils.js +25 -34
- package/lib/Utils/auth-utils.js.map +1 -0
- package/lib/Utils/baileys-event-stream.d.ts +2 -1
- package/lib/Utils/baileys-event-stream.d.ts.map +1 -0
- package/lib/Utils/baileys-event-stream.js +15 -22
- package/lib/Utils/baileys-event-stream.js.map +1 -0
- package/lib/Utils/business.d.ts +3 -2
- package/lib/Utils/business.d.ts.map +1 -0
- package/lib/Utils/business.js +61 -70
- package/lib/Utils/business.js.map +1 -0
- package/lib/Utils/chat-utils.d.ts +8 -7
- package/lib/Utils/chat-utils.d.ts.map +1 -0
- package/lib/Utils/chat-utils.js +130 -137
- package/lib/Utils/chat-utils.js.map +1 -0
- package/lib/Utils/crypto.d.ts +2 -1
- package/lib/Utils/crypto.d.ts.map +1 -0
- package/lib/Utils/crypto.js +37 -86
- package/lib/Utils/crypto.js.map +1 -0
- package/lib/Utils/decode-wa-message.d.ts +5 -4
- package/lib/Utils/decode-wa-message.d.ts.map +1 -0
- package/lib/Utils/decode-wa-message.js +38 -44
- package/lib/Utils/decode-wa-message.js.map +1 -0
- package/lib/Utils/event-buffer.d.ts +4 -4
- package/lib/Utils/event-buffer.d.ts.map +1 -0
- package/lib/Utils/event-buffer.js +37 -50
- package/lib/Utils/event-buffer.js.map +1 -0
- package/lib/Utils/generics.d.ts +9 -8
- package/lib/Utils/generics.d.ts.map +1 -0
- package/lib/Utils/generics.js +87 -114
- package/lib/Utils/generics.js.map +1 -0
- package/lib/Utils/history.d.ts +4 -3
- package/lib/Utils/history.d.ts.map +1 -0
- package/lib/Utils/history.js +32 -40
- package/lib/Utils/history.js.map +1 -0
- package/lib/Utils/index.d.ts +18 -17
- package/lib/Utils/index.d.ts.map +1 -0
- package/lib/Utils/index.js +18 -33
- package/lib/Utils/index.js.map +1 -0
- package/lib/Utils/link-preview.d.ts +4 -3
- package/lib/Utils/link-preview.d.ts.map +1 -0
- package/lib/Utils/link-preview.js +10 -47
- package/lib/Utils/link-preview.js.map +1 -0
- package/lib/Utils/logger.d.ts +8 -6
- package/lib/Utils/logger.d.ts.map +1 -0
- package/lib/Utils/logger.js +3 -7
- package/lib/Utils/logger.js.map +1 -0
- package/lib/Utils/lt-hash.d.ts +9 -8
- package/lib/Utils/lt-hash.d.ts.map +1 -0
- package/lib/Utils/lt-hash.js +23 -26
- package/lib/Utils/lt-hash.js.map +1 -0
- package/lib/Utils/make-mutex.d.ts +1 -0
- package/lib/Utils/make-mutex.d.ts.map +1 -0
- package/lib/Utils/make-mutex.js +5 -9
- package/lib/Utils/make-mutex.js.map +1 -0
- package/lib/Utils/messages-media.d.ts +11 -10
- package/lib/Utils/messages-media.d.ts.map +1 -0
- package/lib/Utils/messages-media.js +141 -203
- package/lib/Utils/messages-media.js.map +1 -0
- package/lib/Utils/messages.d.ts +7 -6
- package/lib/Utils/messages.d.ts.map +1 -0
- package/lib/Utils/messages.js +190 -199
- package/lib/Utils/messages.js.map +1 -0
- package/lib/Utils/noise-handler.d.ts +5 -4
- package/lib/Utils/noise-handler.d.ts.map +1 -0
- package/lib/Utils/noise-handler.js +22 -26
- package/lib/Utils/noise-handler.js.map +1 -0
- package/lib/Utils/process-message.d.ts +5 -4
- package/lib/Utils/process-message.d.ts.map +1 -0
- package/lib/Utils/process-message.js +95 -104
- package/lib/Utils/process-message.js.map +1 -0
- package/lib/Utils/signal.d.ts +5 -4
- package/lib/Utils/signal.d.ts.map +1 -0
- package/lib/Utils/signal.js +47 -52
- package/lib/Utils/signal.js.map +1 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +2 -1
- package/lib/Utils/use-multi-file-auth-state.d.ts.map +1 -0
- package/lib/Utils/use-multi-file-auth-state.js +23 -26
- package/lib/Utils/use-multi-file-auth-state.js.map +1 -0
- package/lib/Utils/validate-connection.d.ts +4 -3
- package/lib/Utils/validate-connection.d.ts.map +1 -0
- package/lib/Utils/validate-connection.js +52 -58
- package/lib/Utils/validate-connection.js.map +1 -0
- package/lib/WABinary/constants.d.ts +1 -0
- package/lib/WABinary/constants.d.ts.map +1 -0
- package/lib/WABinary/constants.js +9 -11
- package/lib/WABinary/constants.js.map +1 -0
- package/lib/WABinary/decode.d.ts +2 -1
- package/lib/WABinary/decode.d.ts.map +1 -0
- package/lib/WABinary/decode.js +13 -51
- package/lib/WABinary/decode.js.map +1 -0
- package/lib/WABinary/encode.d.ts +2 -1
- package/lib/WABinary/encode.d.ts.map +1 -0
- package/lib/WABinary/encode.js +5 -41
- package/lib/WABinary/encode.js.map +1 -0
- package/lib/WABinary/generic-utils.d.ts +4 -3
- package/lib/WABinary/generic-utils.d.ts.map +1 -0
- package/lib/WABinary/generic-utils.js +30 -38
- package/lib/WABinary/generic-utils.js.map +1 -0
- package/lib/WABinary/index.d.ts +6 -5
- package/lib/WABinary/index.d.ts.map +1 -0
- package/lib/WABinary/index.js +6 -21
- package/lib/WABinary/index.js.map +1 -0
- package/lib/WABinary/jid-utils.d.ts +1 -0
- package/lib/WABinary/jid-utils.d.ts.map +1 -0
- package/lib/WABinary/jid-utils.js +21 -35
- package/lib/WABinary/jid-utils.js.map +1 -0
- package/lib/WABinary/types.d.ts +2 -1
- package/lib/WABinary/types.d.ts.map +1 -0
- package/lib/WABinary/types.js +2 -2
- package/lib/WABinary/types.js.map +1 -0
- package/lib/WAM/BinaryInfo.d.ts +2 -1
- package/lib/WAM/BinaryInfo.d.ts.map +1 -0
- package/lib/WAM/BinaryInfo.js +2 -5
- package/lib/WAM/BinaryInfo.js.map +1 -0
- package/lib/WAM/constants.d.ts +1 -0
- package/lib/WAM/constants.d.ts.map +1 -0
- package/lib/WAM/constants.js +4 -6
- package/lib/WAM/constants.js.map +1 -0
- package/lib/WAM/encode.d.ts +2 -1
- package/lib/WAM/encode.d.ts.map +1 -0
- package/lib/WAM/encode.js +12 -14
- package/lib/WAM/encode.js.map +1 -0
- package/lib/WAM/index.d.ts +4 -3
- package/lib/WAM/index.d.ts.map +1 -0
- package/lib/WAM/index.js +4 -19
- package/lib/WAM/index.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +4 -3
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +6 -9
- package/lib/WAUSync/Protocols/USyncContactProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +3 -2
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +9 -12
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +3 -2
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +6 -9
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +3 -2
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +7 -11
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +4 -3
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +19 -21
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +3 -2
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +2 -5
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/index.d.ts +5 -4
- package/lib/WAUSync/Protocols/index.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/index.js +5 -20
- package/lib/WAUSync/Protocols/index.js.map +1 -0
- package/lib/WAUSync/USyncQuery.d.ts +4 -3
- package/lib/WAUSync/USyncQuery.d.ts.map +1 -0
- package/lib/WAUSync/USyncQuery.js +18 -20
- package/lib/WAUSync/USyncQuery.js.map +1 -0
- package/lib/WAUSync/USyncUser.d.ts +6 -5
- package/lib/WAUSync/USyncUser.d.ts.map +1 -0
- package/lib/WAUSync/USyncUser.js +2 -5
- package/lib/WAUSync/USyncUser.js.map +1 -0
- package/lib/WAUSync/index.d.ts +4 -3
- package/lib/WAUSync/index.d.ts.map +1 -0
- package/lib/WAUSync/index.js +4 -19
- package/lib/WAUSync/index.js.map +1 -0
- package/lib/index.d.ts +9 -8
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +11 -30
- package/lib/index.js.map +1 -0
- package/package.json +26 -26
|
@@ -1,39 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
const make_mutex_1 = require("../Utils/make-mutex");
|
|
15
|
-
const WABinary_1 = require("../WABinary");
|
|
16
|
-
const groups_1 = require("./groups");
|
|
17
|
-
const messages_send_1 = require("./messages-send");
|
|
18
|
-
const makeMessagesRecvSocket = (config) => {
|
|
1
|
+
import NodeCache from '@cacheable/node-cache';
|
|
2
|
+
import { Boom } from '@hapi/boom';
|
|
3
|
+
import { randomBytes } from 'crypto';
|
|
4
|
+
import Long from 'long';
|
|
5
|
+
import { proto } from '../../WAProto/index.js';
|
|
6
|
+
import { DEFAULT_CACHE_TTLS, KEY_BUNDLE_TYPE, MIN_PREKEY_COUNT } from '../Defaults/index.js';
|
|
7
|
+
import { WAMessageStatus, WAMessageStubType } from '../Types/index.js';
|
|
8
|
+
import { aesDecryptCTR, aesEncryptGCM, cleanMessage, Curve, decodeMediaRetryNode, decodeMessageNode, decryptMessageNode, delay, derivePairingCodeKey, encodeBigEndian, encodeSignedDeviceIdentity, getCallStatusFromNode, getHistoryMsg, getNextPreKeys, getStatusFromReceiptType, hkdf, MISSING_KEYS_ERROR_TEXT, NACK_REASONS, NO_MESSAGE_FOUND_ERROR_TEXT, unixTimestampSeconds, xmppPreKey, xmppSignedPreKey } from '../Utils/index.js';
|
|
9
|
+
import { makeMutex } from '../Utils/make-mutex.js';
|
|
10
|
+
import { areJidsSameUser, getAllBinaryNodeChildren, getBinaryNodeChild, getBinaryNodeChildBuffer, getBinaryNodeChildren, getBinaryNodeChildString, isJidGroup, isJidStatusBroadcast, isJidUser, isLidUser, jidDecode, jidNormalizedUser, S_WHATSAPP_NET } from '../WABinary/index.js';
|
|
11
|
+
import { extractGroupMetadata } from './groups.js';
|
|
12
|
+
import { makeMessagesSocket } from './messages-send.js';
|
|
13
|
+
export const makeMessagesRecvSocket = (config) => {
|
|
19
14
|
const { logger, retryRequestDelayMs, maxMsgRetryCount, getMessage, shouldIgnoreJid } = config;
|
|
20
|
-
const sock =
|
|
15
|
+
const sock = makeMessagesSocket(config);
|
|
21
16
|
const { ev, authState, ws, processingMutex, signalRepository, query, upsertMessage, resyncAppState, onUnexpectedError, assertSessions, sendNode, relayMessage, sendReceipt, uploadPreKeys, sendPeerDataOperationMessage } = sock;
|
|
22
17
|
/** this mutex ensures that each retryRequest will wait for the previous one to finish */
|
|
23
|
-
const retryMutex =
|
|
18
|
+
const retryMutex = makeMutex();
|
|
24
19
|
const msgRetryCache = config.msgRetryCounterCache ||
|
|
25
|
-
new
|
|
26
|
-
stdTTL:
|
|
20
|
+
new NodeCache({
|
|
21
|
+
stdTTL: DEFAULT_CACHE_TTLS.MSG_RETRY, // 1 hour
|
|
27
22
|
useClones: false
|
|
28
23
|
});
|
|
29
24
|
const callOfferCache = config.callOfferCache ||
|
|
30
|
-
new
|
|
31
|
-
stdTTL:
|
|
25
|
+
new NodeCache({
|
|
26
|
+
stdTTL: DEFAULT_CACHE_TTLS.CALL_OFFER, // 5 mins
|
|
32
27
|
useClones: false
|
|
33
28
|
});
|
|
34
29
|
const placeholderResendCache = config.placeholderResendCache ||
|
|
35
|
-
new
|
|
36
|
-
stdTTL:
|
|
30
|
+
new NodeCache({
|
|
31
|
+
stdTTL: DEFAULT_CACHE_TTLS.MSG_RETRY, // 1 hour
|
|
37
32
|
useClones: false
|
|
38
33
|
});
|
|
39
34
|
let sendActiveReceipts = false;
|
|
@@ -56,10 +51,10 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
56
51
|
stanza.attrs.recipient = attrs.recipient;
|
|
57
52
|
}
|
|
58
53
|
if (!!attrs.type &&
|
|
59
|
-
(tag !== 'message' ||
|
|
54
|
+
(tag !== 'message' || getBinaryNodeChild({ tag, attrs, content }, 'unavailable') || errorCode !== 0)) {
|
|
60
55
|
stanza.attrs.type = attrs.type;
|
|
61
56
|
}
|
|
62
|
-
if (tag === 'message' &&
|
|
57
|
+
if (tag === 'message' && getBinaryNodeChild({ tag, attrs, content }, 'unavailable')) {
|
|
63
58
|
stanza.attrs.from = authState.creds.me.id;
|
|
64
59
|
}
|
|
65
60
|
logger.debug({ recv: { tag, attrs }, sent: stanza.attrs }, 'sent ack');
|
|
@@ -87,10 +82,10 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
87
82
|
await query(stanza);
|
|
88
83
|
};
|
|
89
84
|
const sendRetryRequest = async (node, forceIncludeKeys = false) => {
|
|
90
|
-
const { fullMessage } =
|
|
85
|
+
const { fullMessage } = decodeMessageNode(node, authState.creds.me.id, authState.creds.me.lid || '');
|
|
91
86
|
const { key: msgKey } = fullMessage;
|
|
92
87
|
const msgId = msgKey.id;
|
|
93
|
-
const key = `${msgId}:${msgKey
|
|
88
|
+
const key = `${msgId}:${msgKey?.participant}`;
|
|
94
89
|
let retryCount = msgRetryCache.get(key) || 0;
|
|
95
90
|
if (retryCount >= maxMsgRetryCount) {
|
|
96
91
|
logger.debug({ retryCount, msgId }, 'reached retry limit, clearing');
|
|
@@ -105,7 +100,7 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
105
100
|
const msgId = await requestPlaceholderResend(msgKey);
|
|
106
101
|
logger.debug(`sendRetryRequest: requested placeholder resend for message ${msgId}`);
|
|
107
102
|
}
|
|
108
|
-
const deviceIdentity =
|
|
103
|
+
const deviceIdentity = encodeSignedDeviceIdentity(account, true);
|
|
109
104
|
await authState.keys.transaction(async () => {
|
|
110
105
|
const receipt = {
|
|
111
106
|
tag: 'receipt',
|
|
@@ -127,7 +122,7 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
127
122
|
{
|
|
128
123
|
tag: 'registration',
|
|
129
124
|
attrs: {},
|
|
130
|
-
content:
|
|
125
|
+
content: encodeBigEndian(authState.creds.registrationId)
|
|
131
126
|
}
|
|
132
127
|
]
|
|
133
128
|
};
|
|
@@ -138,7 +133,7 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
138
133
|
receipt.attrs.participant = node.attrs.participant;
|
|
139
134
|
}
|
|
140
135
|
if (retryCount > 1 || forceIncludeKeys) {
|
|
141
|
-
const { update, preKeys } = await
|
|
136
|
+
const { update, preKeys } = await getNextPreKeys(authState, 1);
|
|
142
137
|
const [keyId] = Object.keys(preKeys);
|
|
143
138
|
const key = preKeys[+keyId];
|
|
144
139
|
const content = receipt.content;
|
|
@@ -146,10 +141,10 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
146
141
|
tag: 'keys',
|
|
147
142
|
attrs: {},
|
|
148
143
|
content: [
|
|
149
|
-
{ tag: 'type', attrs: {}, content: Buffer.from(
|
|
144
|
+
{ tag: 'type', attrs: {}, content: Buffer.from(KEY_BUNDLE_TYPE) },
|
|
150
145
|
{ tag: 'identity', attrs: {}, content: identityKey.public },
|
|
151
|
-
|
|
152
|
-
|
|
146
|
+
xmppPreKey(key, +keyId),
|
|
147
|
+
xmppSignedPreKey(signedPreKey),
|
|
153
148
|
{ tag: 'device-identity', attrs: {}, content: deviceIdentity }
|
|
154
149
|
]
|
|
155
150
|
});
|
|
@@ -161,17 +156,17 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
161
156
|
};
|
|
162
157
|
const handleEncryptNotification = async (node) => {
|
|
163
158
|
const from = node.attrs.from;
|
|
164
|
-
if (from ===
|
|
165
|
-
const countChild =
|
|
159
|
+
if (from === S_WHATSAPP_NET) {
|
|
160
|
+
const countChild = getBinaryNodeChild(node, 'count');
|
|
166
161
|
const count = +countChild.attrs.value;
|
|
167
|
-
const shouldUploadMorePreKeys = count <
|
|
162
|
+
const shouldUploadMorePreKeys = count < MIN_PREKEY_COUNT;
|
|
168
163
|
logger.debug({ count, shouldUploadMorePreKeys }, 'recv pre-key count');
|
|
169
164
|
if (shouldUploadMorePreKeys) {
|
|
170
165
|
await uploadPreKeys();
|
|
171
166
|
}
|
|
172
167
|
}
|
|
173
168
|
else {
|
|
174
|
-
const identityNode =
|
|
169
|
+
const identityNode = getBinaryNodeChild(node, 'identity');
|
|
175
170
|
if (identityNode) {
|
|
176
171
|
logger.info({ jid: from }, 'identity changed');
|
|
177
172
|
// not handling right now
|
|
@@ -183,12 +178,11 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
183
178
|
}
|
|
184
179
|
};
|
|
185
180
|
const handleGroupNotification = (participant, child, msg) => {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
switch (child === null || child === void 0 ? void 0 : child.tag) {
|
|
181
|
+
const participantJid = getBinaryNodeChild(child, 'participant')?.attrs?.jid || participant;
|
|
182
|
+
switch (child?.tag) {
|
|
189
183
|
case 'create':
|
|
190
|
-
const metadata =
|
|
191
|
-
msg.messageStubType =
|
|
184
|
+
const metadata = extractGroupMetadata(child);
|
|
185
|
+
msg.messageStubType = WAMessageStubType.GROUP_CREATE;
|
|
192
186
|
msg.messageStubParameters = [metadata.subject];
|
|
193
187
|
msg.key = { participant: metadata.owner };
|
|
194
188
|
ev.emit('chats.upsert', [
|
|
@@ -209,15 +203,15 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
209
203
|
case 'not_ephemeral':
|
|
210
204
|
msg.message = {
|
|
211
205
|
protocolMessage: {
|
|
212
|
-
type:
|
|
206
|
+
type: proto.Message.ProtocolMessage.Type.EPHEMERAL_SETTING,
|
|
213
207
|
ephemeralExpiration: +(child.attrs.expiration || 0)
|
|
214
208
|
}
|
|
215
209
|
};
|
|
216
210
|
break;
|
|
217
211
|
case 'modify':
|
|
218
|
-
const oldNumber =
|
|
212
|
+
const oldNumber = getBinaryNodeChildren(child, 'participant').map(p => p.attrs.jid);
|
|
219
213
|
msg.messageStubParameters = oldNumber || [];
|
|
220
|
-
msg.messageStubType =
|
|
214
|
+
msg.messageStubType = WAMessageStubType.GROUP_PARTICIPANT_CHANGE_NUMBER;
|
|
221
215
|
break;
|
|
222
216
|
case 'promote':
|
|
223
217
|
case 'demote':
|
|
@@ -225,74 +219,73 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
225
219
|
case 'add':
|
|
226
220
|
case 'leave':
|
|
227
221
|
const stubType = `GROUP_PARTICIPANT_${child.tag.toUpperCase()}`;
|
|
228
|
-
msg.messageStubType =
|
|
229
|
-
const participants =
|
|
222
|
+
msg.messageStubType = WAMessageStubType[stubType];
|
|
223
|
+
const participants = getBinaryNodeChildren(child, 'participant').map(p => p.attrs.jid);
|
|
230
224
|
if (participants.length === 1 &&
|
|
231
225
|
// if recv. "remove" message and sender removed themselves
|
|
232
226
|
// mark as left
|
|
233
|
-
|
|
227
|
+
areJidsSameUser(participants[0], participant) &&
|
|
234
228
|
child.tag === 'remove') {
|
|
235
|
-
msg.messageStubType =
|
|
229
|
+
msg.messageStubType = WAMessageStubType.GROUP_PARTICIPANT_LEAVE;
|
|
236
230
|
}
|
|
237
231
|
msg.messageStubParameters = participants;
|
|
238
232
|
break;
|
|
239
233
|
case 'subject':
|
|
240
|
-
msg.messageStubType =
|
|
234
|
+
msg.messageStubType = WAMessageStubType.GROUP_CHANGE_SUBJECT;
|
|
241
235
|
msg.messageStubParameters = [child.attrs.subject];
|
|
242
236
|
break;
|
|
243
237
|
case 'description':
|
|
244
|
-
const description =
|
|
245
|
-
msg.messageStubType =
|
|
238
|
+
const description = getBinaryNodeChild(child, 'body')?.content?.toString();
|
|
239
|
+
msg.messageStubType = WAMessageStubType.GROUP_CHANGE_DESCRIPTION;
|
|
246
240
|
msg.messageStubParameters = description ? [description] : undefined;
|
|
247
241
|
break;
|
|
248
242
|
case 'announcement':
|
|
249
243
|
case 'not_announcement':
|
|
250
|
-
msg.messageStubType =
|
|
244
|
+
msg.messageStubType = WAMessageStubType.GROUP_CHANGE_ANNOUNCE;
|
|
251
245
|
msg.messageStubParameters = [child.tag === 'announcement' ? 'on' : 'off'];
|
|
252
246
|
break;
|
|
253
247
|
case 'locked':
|
|
254
248
|
case 'unlocked':
|
|
255
|
-
msg.messageStubType =
|
|
249
|
+
msg.messageStubType = WAMessageStubType.GROUP_CHANGE_RESTRICT;
|
|
256
250
|
msg.messageStubParameters = [child.tag === 'locked' ? 'on' : 'off'];
|
|
257
251
|
break;
|
|
258
252
|
case 'invite':
|
|
259
|
-
msg.messageStubType =
|
|
253
|
+
msg.messageStubType = WAMessageStubType.GROUP_CHANGE_INVITE_LINK;
|
|
260
254
|
msg.messageStubParameters = [child.attrs.code];
|
|
261
255
|
break;
|
|
262
256
|
case 'member_add_mode':
|
|
263
257
|
const addMode = child.content;
|
|
264
258
|
if (addMode) {
|
|
265
|
-
msg.messageStubType =
|
|
259
|
+
msg.messageStubType = WAMessageStubType.GROUP_MEMBER_ADD_MODE;
|
|
266
260
|
msg.messageStubParameters = [addMode.toString()];
|
|
267
261
|
}
|
|
268
262
|
break;
|
|
269
263
|
case 'membership_approval_mode':
|
|
270
|
-
const approvalMode =
|
|
264
|
+
const approvalMode = getBinaryNodeChild(child, 'group_join');
|
|
271
265
|
if (approvalMode) {
|
|
272
|
-
msg.messageStubType =
|
|
266
|
+
msg.messageStubType = WAMessageStubType.GROUP_MEMBERSHIP_JOIN_APPROVAL_MODE;
|
|
273
267
|
msg.messageStubParameters = [approvalMode.attrs.state];
|
|
274
268
|
}
|
|
275
269
|
break;
|
|
276
270
|
case 'created_membership_requests':
|
|
277
|
-
msg.messageStubType =
|
|
271
|
+
msg.messageStubType = WAMessageStubType.GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD;
|
|
278
272
|
msg.messageStubParameters = [participantJid, 'created', child.attrs.request_method];
|
|
279
273
|
break;
|
|
280
274
|
case 'revoked_membership_requests':
|
|
281
|
-
const isDenied =
|
|
282
|
-
msg.messageStubType =
|
|
275
|
+
const isDenied = areJidsSameUser(participantJid, participant);
|
|
276
|
+
msg.messageStubType = WAMessageStubType.GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD;
|
|
283
277
|
msg.messageStubParameters = [participantJid, isDenied ? 'revoked' : 'rejected'];
|
|
284
278
|
break;
|
|
285
279
|
}
|
|
286
280
|
};
|
|
287
281
|
const processNotification = async (node) => {
|
|
288
|
-
var _a, _b, _c;
|
|
289
282
|
const result = {};
|
|
290
|
-
const [child] =
|
|
283
|
+
const [child] = getAllBinaryNodeChildren(node);
|
|
291
284
|
const nodeType = node.attrs.type;
|
|
292
|
-
const from =
|
|
285
|
+
const from = jidNormalizedUser(node.attrs.from);
|
|
293
286
|
switch (nodeType) {
|
|
294
287
|
case 'privacy_token':
|
|
295
|
-
const tokenList =
|
|
288
|
+
const tokenList = getBinaryNodeChildren(child, 'token');
|
|
296
289
|
for (const { attrs, content } of tokenList) {
|
|
297
290
|
const jid = attrs.jid;
|
|
298
291
|
ev.emit('chats.update', [
|
|
@@ -314,45 +307,45 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
314
307
|
handleGroupNotification(node.attrs.participant, child, result);
|
|
315
308
|
break;
|
|
316
309
|
case 'mediaretry':
|
|
317
|
-
const event =
|
|
310
|
+
const event = decodeMediaRetryNode(node);
|
|
318
311
|
ev.emit('messages.media-update', [event]);
|
|
319
312
|
break;
|
|
320
313
|
case 'encrypt':
|
|
321
314
|
await handleEncryptNotification(node);
|
|
322
315
|
break;
|
|
323
316
|
case 'devices':
|
|
324
|
-
const devices =
|
|
325
|
-
if (
|
|
317
|
+
const devices = getBinaryNodeChildren(child, 'device');
|
|
318
|
+
if (areJidsSameUser(child.attrs.jid, authState.creds.me.id)) {
|
|
326
319
|
const deviceJids = devices.map(d => d.attrs.jid);
|
|
327
320
|
logger.info({ deviceJids }, 'got my own devices');
|
|
328
321
|
}
|
|
329
322
|
break;
|
|
330
323
|
case 'server_sync':
|
|
331
|
-
const update =
|
|
324
|
+
const update = getBinaryNodeChild(node, 'collection');
|
|
332
325
|
if (update) {
|
|
333
326
|
const name = update.attrs.name;
|
|
334
327
|
await resyncAppState([name], false);
|
|
335
328
|
}
|
|
336
329
|
break;
|
|
337
330
|
case 'picture':
|
|
338
|
-
const setPicture =
|
|
339
|
-
const delPicture =
|
|
331
|
+
const setPicture = getBinaryNodeChild(node, 'set');
|
|
332
|
+
const delPicture = getBinaryNodeChild(node, 'delete');
|
|
340
333
|
ev.emit('contacts.update', [
|
|
341
334
|
{
|
|
342
|
-
id:
|
|
335
|
+
id: jidNormalizedUser(node?.attrs?.from) || (setPicture || delPicture)?.attrs?.hash || '',
|
|
343
336
|
imgUrl: setPicture ? 'changed' : 'removed'
|
|
344
337
|
}
|
|
345
338
|
]);
|
|
346
|
-
if (
|
|
339
|
+
if (isJidGroup(from)) {
|
|
347
340
|
const node = setPicture || delPicture;
|
|
348
|
-
result.messageStubType =
|
|
341
|
+
result.messageStubType = WAMessageStubType.GROUP_CHANGE_ICON;
|
|
349
342
|
if (setPicture) {
|
|
350
343
|
result.messageStubParameters = [setPicture.attrs.id];
|
|
351
344
|
}
|
|
352
|
-
result.participant = node
|
|
345
|
+
result.participant = node?.attrs.author;
|
|
353
346
|
result.key = {
|
|
354
347
|
...(result.key || {}),
|
|
355
|
-
participant: setPicture
|
|
348
|
+
participant: setPicture?.attrs.author
|
|
356
349
|
};
|
|
357
350
|
}
|
|
358
351
|
break;
|
|
@@ -372,7 +365,7 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
372
365
|
});
|
|
373
366
|
}
|
|
374
367
|
else if (child.tag === 'blocklist') {
|
|
375
|
-
const blocklists =
|
|
368
|
+
const blocklists = getBinaryNodeChildren(child, 'item');
|
|
376
369
|
for (const { attrs } of blocklists) {
|
|
377
370
|
const blocklist = [attrs.jid];
|
|
378
371
|
const type = attrs.action === 'block' ? 'add' : 'remove';
|
|
@@ -381,15 +374,15 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
381
374
|
}
|
|
382
375
|
break;
|
|
383
376
|
case 'link_code_companion_reg':
|
|
384
|
-
const linkCodeCompanionReg =
|
|
385
|
-
const ref = toRequiredBuffer(
|
|
386
|
-
const primaryIdentityPublicKey = toRequiredBuffer(
|
|
387
|
-
const primaryEphemeralPublicKeyWrapped = toRequiredBuffer(
|
|
377
|
+
const linkCodeCompanionReg = getBinaryNodeChild(node, 'link_code_companion_reg');
|
|
378
|
+
const ref = toRequiredBuffer(getBinaryNodeChildBuffer(linkCodeCompanionReg, 'link_code_pairing_ref'));
|
|
379
|
+
const primaryIdentityPublicKey = toRequiredBuffer(getBinaryNodeChildBuffer(linkCodeCompanionReg, 'primary_identity_pub'));
|
|
380
|
+
const primaryEphemeralPublicKeyWrapped = toRequiredBuffer(getBinaryNodeChildBuffer(linkCodeCompanionReg, 'link_code_pairing_wrapped_primary_ephemeral_pub'));
|
|
388
381
|
const codePairingPublicKey = await decipherLinkPublicKey(primaryEphemeralPublicKeyWrapped);
|
|
389
|
-
const companionSharedKey =
|
|
390
|
-
const random =
|
|
391
|
-
const linkCodeSalt =
|
|
392
|
-
const linkCodePairingExpanded = await
|
|
382
|
+
const companionSharedKey = Curve.sharedKey(authState.creds.pairingEphemeralKeyPair.private, codePairingPublicKey);
|
|
383
|
+
const random = randomBytes(32);
|
|
384
|
+
const linkCodeSalt = randomBytes(32);
|
|
385
|
+
const linkCodePairingExpanded = await hkdf(companionSharedKey, 32, {
|
|
393
386
|
salt: linkCodeSalt,
|
|
394
387
|
info: 'link_code_pairing_key_bundle_encryption_key'
|
|
395
388
|
});
|
|
@@ -398,16 +391,16 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
398
391
|
primaryIdentityPublicKey,
|
|
399
392
|
random
|
|
400
393
|
]);
|
|
401
|
-
const encryptIv =
|
|
402
|
-
const encrypted =
|
|
394
|
+
const encryptIv = randomBytes(12);
|
|
395
|
+
const encrypted = aesEncryptGCM(encryptPayload, linkCodePairingExpanded, encryptIv, Buffer.alloc(0));
|
|
403
396
|
const encryptedPayload = Buffer.concat([linkCodeSalt, encryptIv, encrypted]);
|
|
404
|
-
const identitySharedKey =
|
|
397
|
+
const identitySharedKey = Curve.sharedKey(authState.creds.signedIdentityKey.private, primaryIdentityPublicKey);
|
|
405
398
|
const identityPayload = Buffer.concat([companionSharedKey, identitySharedKey, random]);
|
|
406
|
-
authState.creds.advSecretKey = (await
|
|
399
|
+
authState.creds.advSecretKey = (await hkdf(identityPayload, 32, { info: 'adv_secret' })).toString('base64');
|
|
407
400
|
await query({
|
|
408
401
|
tag: 'iq',
|
|
409
402
|
attrs: {
|
|
410
|
-
to:
|
|
403
|
+
to: S_WHATSAPP_NET,
|
|
411
404
|
type: 'set',
|
|
412
405
|
id: sock.generateMessageTag(),
|
|
413
406
|
xmlns: 'md'
|
|
@@ -449,14 +442,14 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
449
442
|
async function decipherLinkPublicKey(data) {
|
|
450
443
|
const buffer = toRequiredBuffer(data);
|
|
451
444
|
const salt = buffer.slice(0, 32);
|
|
452
|
-
const secretKey = await
|
|
445
|
+
const secretKey = await derivePairingCodeKey(authState.creds.pairingCode, salt);
|
|
453
446
|
const iv = buffer.slice(32, 48);
|
|
454
447
|
const payload = buffer.slice(48, 80);
|
|
455
|
-
return
|
|
448
|
+
return aesDecryptCTR(payload, secretKey, iv);
|
|
456
449
|
}
|
|
457
450
|
function toRequiredBuffer(data) {
|
|
458
451
|
if (data === undefined) {
|
|
459
|
-
throw new
|
|
452
|
+
throw new Boom('Invalid buffer', { statusCode: 400 });
|
|
460
453
|
}
|
|
461
454
|
return data instanceof Buffer ? data : Buffer.from(data);
|
|
462
455
|
}
|
|
@@ -471,7 +464,6 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
471
464
|
msgRetryCache.set(key, newValue);
|
|
472
465
|
};
|
|
473
466
|
const sendMessagesAgain = async (key, ids, retryNode) => {
|
|
474
|
-
var _a;
|
|
475
467
|
// todo: implement a cache to store the last 256 sent messages (copy whatsmeow)
|
|
476
468
|
const msgs = await Promise.all(ids.map(id => getMessage({ ...key, id })));
|
|
477
469
|
const remoteJid = key.remoteJid;
|
|
@@ -479,9 +471,9 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
479
471
|
// if it's the primary jid sending the request
|
|
480
472
|
// just re-send the message to everyone
|
|
481
473
|
// prevents the first message decryption failure
|
|
482
|
-
const sendToAll = !
|
|
474
|
+
const sendToAll = !jidDecode(participant)?.device;
|
|
483
475
|
await assertSessions([participant], true);
|
|
484
|
-
if (
|
|
476
|
+
if (isJidGroup(remoteJid)) {
|
|
485
477
|
await authState.keys.set({ 'sender-key-memory': { [remoteJid]: null } });
|
|
486
478
|
}
|
|
487
479
|
logger.debug({ participant, sendToAll }, 'forced new session for retry recp');
|
|
@@ -506,11 +498,10 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
506
498
|
}
|
|
507
499
|
};
|
|
508
500
|
const handleReceipt = async (node) => {
|
|
509
|
-
var _a, _b;
|
|
510
501
|
const { attrs, content } = node;
|
|
511
502
|
const isLid = attrs.from.includes('lid');
|
|
512
|
-
const isNodeFromMe =
|
|
513
|
-
const remoteJid = !isNodeFromMe ||
|
|
503
|
+
const isNodeFromMe = areJidsSameUser(attrs.participant || attrs.from, isLid ? authState.creds.me?.lid : authState.creds.me?.id);
|
|
504
|
+
const remoteJid = !isNodeFromMe || isJidGroup(attrs.from) ? attrs.from : attrs.recipient;
|
|
514
505
|
const fromMe = !attrs.recipient || ((attrs.type === 'retry' || attrs.type === 'sender') && isNodeFromMe);
|
|
515
506
|
const key = {
|
|
516
507
|
remoteJid,
|
|
@@ -525,24 +516,24 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
525
516
|
}
|
|
526
517
|
const ids = [attrs.id];
|
|
527
518
|
if (Array.isArray(content)) {
|
|
528
|
-
const items =
|
|
519
|
+
const items = getBinaryNodeChildren(content[0], 'item');
|
|
529
520
|
ids.push(...items.map(i => i.attrs.id));
|
|
530
521
|
}
|
|
531
522
|
try {
|
|
532
523
|
await Promise.all([
|
|
533
524
|
processingMutex.mutex(async () => {
|
|
534
|
-
const status =
|
|
525
|
+
const status = getStatusFromReceiptType(attrs.type);
|
|
535
526
|
if (typeof status !== 'undefined' &&
|
|
536
527
|
// basically, we only want to know when a message from us has been delivered to/read by the other person
|
|
537
528
|
// or another device of ours has read some messages
|
|
538
|
-
(status >=
|
|
539
|
-
if (
|
|
529
|
+
(status >= proto.WebMessageInfo.Status.SERVER_ACK || !isNodeFromMe)) {
|
|
530
|
+
if (isJidGroup(remoteJid) || isJidStatusBroadcast(remoteJid)) {
|
|
540
531
|
if (attrs.participant) {
|
|
541
|
-
const updateKey = status ===
|
|
532
|
+
const updateKey = status === proto.WebMessageInfo.Status.DELIVERY_ACK ? 'receiptTimestamp' : 'readTimestamp';
|
|
542
533
|
ev.emit('message-receipt.update', ids.map(id => ({
|
|
543
534
|
key: { ...key, id },
|
|
544
535
|
receipt: {
|
|
545
|
-
userJid:
|
|
536
|
+
userJid: jidNormalizedUser(attrs.participant),
|
|
546
537
|
[updateKey]: +attrs.t
|
|
547
538
|
}
|
|
548
539
|
})));
|
|
@@ -558,7 +549,7 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
558
549
|
if (attrs.type === 'retry') {
|
|
559
550
|
// correctly set who is asking for the retry
|
|
560
551
|
key.participant = key.participant || attrs.from;
|
|
561
|
-
const retryNode =
|
|
552
|
+
const retryNode = getBinaryNodeChild(node, 'retry');
|
|
562
553
|
if (willSendMessageAgain(ids[0], key.participant)) {
|
|
563
554
|
if (key.fromMe) {
|
|
564
555
|
try {
|
|
@@ -594,10 +585,9 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
594
585
|
try {
|
|
595
586
|
await Promise.all([
|
|
596
587
|
processingMutex.mutex(async () => {
|
|
597
|
-
var _a;
|
|
598
588
|
const msg = await processNotification(node);
|
|
599
589
|
if (msg) {
|
|
600
|
-
const fromMe =
|
|
590
|
+
const fromMe = areJidsSameUser(node.attrs.participant || remoteJid, authState.creds.me.id);
|
|
601
591
|
msg.key = {
|
|
602
592
|
remoteJid,
|
|
603
593
|
fromMe,
|
|
@@ -605,9 +595,9 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
605
595
|
id: node.attrs.id,
|
|
606
596
|
...(msg.key || {})
|
|
607
597
|
};
|
|
608
|
-
|
|
598
|
+
msg.participant ?? (msg.participant = node.attrs.participant);
|
|
609
599
|
msg.messageTimestamp = +node.attrs.t;
|
|
610
|
-
const fullMsg =
|
|
600
|
+
const fullMsg = proto.WebMessageInfo.fromObject(msg);
|
|
611
601
|
await upsertMessage(fullMsg, 'append');
|
|
612
602
|
}
|
|
613
603
|
})
|
|
@@ -618,13 +608,12 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
618
608
|
}
|
|
619
609
|
};
|
|
620
610
|
const handleMessage = async (node) => {
|
|
621
|
-
var _a, _b, _c;
|
|
622
611
|
if (shouldIgnoreJid(node.attrs.from) && node.attrs.from !== '@s.whatsapp.net') {
|
|
623
612
|
logger.debug({ key: node.attrs.key }, 'ignored message');
|
|
624
613
|
await sendMessageAck(node);
|
|
625
614
|
return;
|
|
626
615
|
}
|
|
627
|
-
const encNode =
|
|
616
|
+
const encNode = getBinaryNodeChild(node, 'enc');
|
|
628
617
|
// TODO: temporary fix for crashes and issues resulting of failed msmsg decryption
|
|
629
618
|
if (encNode && encNode.attrs.type === 'msmsg') {
|
|
630
619
|
logger.debug({ key: node.attrs.key }, 'ignored msmsg');
|
|
@@ -632,9 +621,9 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
632
621
|
return;
|
|
633
622
|
}
|
|
634
623
|
let response;
|
|
635
|
-
if (
|
|
624
|
+
if (getBinaryNodeChild(node, 'unavailable') && !encNode) {
|
|
636
625
|
await sendMessageAck(node);
|
|
637
|
-
const { key } =
|
|
626
|
+
const { key } = decodeMessageNode(node, authState.creds.me.id, authState.creds.me.lid || '').fullMessage;
|
|
638
627
|
response = await requestPlaceholderResend(key);
|
|
639
628
|
if (response === 'RESOLVED') {
|
|
640
629
|
return;
|
|
@@ -646,33 +635,32 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
646
635
|
placeholderResendCache.del(node.attrs.id);
|
|
647
636
|
}
|
|
648
637
|
}
|
|
649
|
-
const { fullMessage: msg, category, author, decrypt } =
|
|
650
|
-
if (response &&
|
|
651
|
-
msg.messageStubParameters = [
|
|
638
|
+
const { fullMessage: msg, category, author, decrypt } = decryptMessageNode(node, authState.creds.me.id, authState.creds.me.lid || '', signalRepository, logger);
|
|
639
|
+
if (response && msg?.messageStubParameters?.[0] === NO_MESSAGE_FOUND_ERROR_TEXT) {
|
|
640
|
+
msg.messageStubParameters = [NO_MESSAGE_FOUND_ERROR_TEXT, response];
|
|
652
641
|
}
|
|
653
|
-
if (
|
|
642
|
+
if (msg.message?.protocolMessage?.type === proto.Message.ProtocolMessage.Type.SHARE_PHONE_NUMBER &&
|
|
654
643
|
node.attrs.sender_pn) {
|
|
655
644
|
ev.emit('chats.phoneNumberShare', { lid: node.attrs.from, jid: node.attrs.sender_pn });
|
|
656
645
|
}
|
|
657
646
|
try {
|
|
658
647
|
await Promise.all([
|
|
659
648
|
processingMutex.mutex(async () => {
|
|
660
|
-
var _a;
|
|
661
649
|
await decrypt();
|
|
662
650
|
// message failed to decrypt
|
|
663
|
-
if (msg.messageStubType ===
|
|
664
|
-
if (
|
|
665
|
-
return sendMessageAck(node,
|
|
651
|
+
if (msg.messageStubType === proto.WebMessageInfo.StubType.CIPHERTEXT) {
|
|
652
|
+
if (msg?.messageStubParameters?.[0] === MISSING_KEYS_ERROR_TEXT) {
|
|
653
|
+
return sendMessageAck(node, NACK_REASONS.ParsingError);
|
|
666
654
|
}
|
|
667
655
|
retryMutex.mutex(async () => {
|
|
668
656
|
if (ws.isOpen) {
|
|
669
|
-
if (
|
|
657
|
+
if (getBinaryNodeChild(node, 'unavailable')) {
|
|
670
658
|
return;
|
|
671
659
|
}
|
|
672
|
-
const encNode =
|
|
660
|
+
const encNode = getBinaryNodeChild(node, 'enc');
|
|
673
661
|
await sendRetryRequest(node, !encNode);
|
|
674
662
|
if (retryRequestDelayMs) {
|
|
675
|
-
await
|
|
663
|
+
await delay(retryRequestDelayMs);
|
|
676
664
|
}
|
|
677
665
|
}
|
|
678
666
|
else {
|
|
@@ -692,7 +680,7 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
692
680
|
// message was sent by us from a different device
|
|
693
681
|
type = 'sender';
|
|
694
682
|
// need to specially handle this case
|
|
695
|
-
if (
|
|
683
|
+
if (isJidUser(msg.key.remoteJid)) {
|
|
696
684
|
participant = author;
|
|
697
685
|
}
|
|
698
686
|
}
|
|
@@ -701,13 +689,13 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
701
689
|
}
|
|
702
690
|
await sendReceipt(msg.key.remoteJid, participant, [msg.key.id], type);
|
|
703
691
|
// send ack for history message
|
|
704
|
-
const isAnyHistoryMsg =
|
|
692
|
+
const isAnyHistoryMsg = getHistoryMsg(msg.message);
|
|
705
693
|
if (isAnyHistoryMsg) {
|
|
706
|
-
const jid =
|
|
694
|
+
const jid = jidNormalizedUser(msg.key.remoteJid);
|
|
707
695
|
await sendReceipt(jid, undefined, [msg.key.id], 'hist_sync');
|
|
708
696
|
}
|
|
709
697
|
}
|
|
710
|
-
|
|
698
|
+
cleanMessage(msg, authState.creds.me.id);
|
|
711
699
|
await sendMessageAck(node);
|
|
712
700
|
await upsertMessage(msg, node.attrs.offline ? 'append' : 'notify');
|
|
713
701
|
})
|
|
@@ -718,9 +706,8 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
718
706
|
}
|
|
719
707
|
};
|
|
720
708
|
const fetchMessageHistory = async (count, oldestMsgKey, oldestMsgTimestamp) => {
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
throw new boom_1.Boom('Not authenticated');
|
|
709
|
+
if (!authState.creds.me?.id) {
|
|
710
|
+
throw new Boom('Not authenticated');
|
|
724
711
|
}
|
|
725
712
|
const pdoMessage = {
|
|
726
713
|
historySyncOnDemandRequest: {
|
|
@@ -730,24 +717,23 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
730
717
|
oldestMsgTimestampMs: oldestMsgTimestamp,
|
|
731
718
|
onDemandMsgCount: count
|
|
732
719
|
},
|
|
733
|
-
peerDataOperationRequestType:
|
|
720
|
+
peerDataOperationRequestType: proto.Message.PeerDataOperationRequestType.HISTORY_SYNC_ON_DEMAND
|
|
734
721
|
};
|
|
735
722
|
return sendPeerDataOperationMessage(pdoMessage);
|
|
736
723
|
};
|
|
737
724
|
const requestPlaceholderResend = async (messageKey) => {
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
throw new boom_1.Boom('Not authenticated');
|
|
725
|
+
if (!authState.creds.me?.id) {
|
|
726
|
+
throw new Boom('Not authenticated');
|
|
741
727
|
}
|
|
742
|
-
if (placeholderResendCache.get(messageKey
|
|
728
|
+
if (placeholderResendCache.get(messageKey?.id)) {
|
|
743
729
|
logger.debug({ messageKey }, 'already requested resend');
|
|
744
730
|
return;
|
|
745
731
|
}
|
|
746
732
|
else {
|
|
747
|
-
placeholderResendCache.set(messageKey
|
|
733
|
+
placeholderResendCache.set(messageKey?.id, true);
|
|
748
734
|
}
|
|
749
|
-
await
|
|
750
|
-
if (!placeholderResendCache.get(messageKey
|
|
735
|
+
await delay(5000);
|
|
736
|
+
if (!placeholderResendCache.get(messageKey?.id)) {
|
|
751
737
|
logger.debug({ messageKey }, 'message received while resend requested');
|
|
752
738
|
return 'RESOLVED';
|
|
753
739
|
}
|
|
@@ -757,22 +743,41 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
757
743
|
messageKey
|
|
758
744
|
}
|
|
759
745
|
],
|
|
760
|
-
peerDataOperationRequestType:
|
|
746
|
+
peerDataOperationRequestType: proto.Message.PeerDataOperationRequestType.PLACEHOLDER_MESSAGE_RESEND
|
|
761
747
|
};
|
|
762
748
|
setTimeout(() => {
|
|
763
|
-
if (placeholderResendCache.get(messageKey
|
|
749
|
+
if (placeholderResendCache.get(messageKey?.id)) {
|
|
764
750
|
logger.debug({ messageKey }, 'PDO message without response after 15 seconds. Phone possibly offline');
|
|
765
|
-
placeholderResendCache.del(messageKey
|
|
751
|
+
placeholderResendCache.del(messageKey?.id);
|
|
766
752
|
}
|
|
767
753
|
}, 15000);
|
|
768
754
|
return sendPeerDataOperationMessage(pdoMessage);
|
|
769
755
|
};
|
|
770
756
|
const handleCall = async (node) => {
|
|
757
|
+
let status;
|
|
771
758
|
const { attrs } = node;
|
|
772
|
-
const [infoChild] =
|
|
759
|
+
const [infoChild] = getAllBinaryNodeChildren(node);
|
|
760
|
+
if (!infoChild) {
|
|
761
|
+
throw new Boom('Missing call info in call node');
|
|
762
|
+
}
|
|
773
763
|
const callId = infoChild.attrs['call-id'];
|
|
774
764
|
const from = infoChild.attrs.from || infoChild.attrs['call-creator'];
|
|
775
|
-
|
|
765
|
+
status = getCallStatusFromNode(infoChild);
|
|
766
|
+
if (isLidUser(from) && infoChild.tag === 'relaylatency') {
|
|
767
|
+
const verify = callOfferCache.get(callId);
|
|
768
|
+
if (!verify) {
|
|
769
|
+
status = 'offer';
|
|
770
|
+
const callLid = {
|
|
771
|
+
chatId: attrs.from,
|
|
772
|
+
from,
|
|
773
|
+
id: callId,
|
|
774
|
+
date: new Date(+attrs.t * 1000),
|
|
775
|
+
offline: !!attrs.offline,
|
|
776
|
+
status
|
|
777
|
+
};
|
|
778
|
+
callOfferCache.set(callId, callLid);
|
|
779
|
+
}
|
|
780
|
+
}
|
|
776
781
|
const call = {
|
|
777
782
|
chatId: attrs.from,
|
|
778
783
|
from,
|
|
@@ -782,7 +787,7 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
782
787
|
status
|
|
783
788
|
};
|
|
784
789
|
if (status === 'offer') {
|
|
785
|
-
call.isVideo = !!
|
|
790
|
+
call.isVideo = !!getBinaryNodeChild(infoChild, 'video');
|
|
786
791
|
call.isGroup = infoChild.attrs.type === 'group' || !!infoChild.attrs['group-jid'];
|
|
787
792
|
call.groupJid = infoChild.attrs['group-jid'];
|
|
788
793
|
callOfferCache.set(call.id, call);
|
|
@@ -823,7 +828,7 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
823
828
|
{
|
|
824
829
|
key,
|
|
825
830
|
update: {
|
|
826
|
-
status:
|
|
831
|
+
status: WAMessageStatus.ERROR,
|
|
827
832
|
messageStubParameters: [attrs.error]
|
|
828
833
|
}
|
|
829
834
|
}
|
|
@@ -883,9 +888,8 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
883
888
|
};
|
|
884
889
|
// Handles newsletter notifications
|
|
885
890
|
async function handleNewsletterNotification(node) {
|
|
886
|
-
var _a;
|
|
887
891
|
const from = node.attrs.from;
|
|
888
|
-
const
|
|
892
|
+
const child = getAllBinaryNodeChildren(node)[0];
|
|
889
893
|
const author = node.attrs.participant;
|
|
890
894
|
logger.info({ from, child }, 'got newsletter notification');
|
|
891
895
|
switch (child.tag) {
|
|
@@ -894,7 +898,7 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
894
898
|
id: from,
|
|
895
899
|
server_id: child.attrs.message_id,
|
|
896
900
|
reaction: {
|
|
897
|
-
code:
|
|
901
|
+
code: getBinaryNodeChildString(child, 'reaction'),
|
|
898
902
|
count: 1
|
|
899
903
|
}
|
|
900
904
|
};
|
|
@@ -904,7 +908,7 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
904
908
|
const viewUpdate = {
|
|
905
909
|
id: from,
|
|
906
910
|
server_id: child.attrs.message_id,
|
|
907
|
-
count: parseInt(
|
|
911
|
+
count: parseInt(child.content?.toString() || '0', 10)
|
|
908
912
|
};
|
|
909
913
|
ev.emit('newsletter.view', viewUpdate);
|
|
910
914
|
break;
|
|
@@ -919,14 +923,14 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
919
923
|
ev.emit('newsletter-participants.update', participantUpdate);
|
|
920
924
|
break;
|
|
921
925
|
case 'update':
|
|
922
|
-
const settingsNode =
|
|
926
|
+
const settingsNode = getBinaryNodeChild(child, 'settings');
|
|
923
927
|
if (settingsNode) {
|
|
924
928
|
const update = {};
|
|
925
|
-
const nameNode =
|
|
926
|
-
if (nameNode
|
|
929
|
+
const nameNode = getBinaryNodeChild(settingsNode, 'name');
|
|
930
|
+
if (nameNode?.content)
|
|
927
931
|
update.name = nameNode.content.toString();
|
|
928
|
-
const descriptionNode =
|
|
929
|
-
if (descriptionNode
|
|
932
|
+
const descriptionNode = getBinaryNodeChild(settingsNode, 'description');
|
|
933
|
+
if (descriptionNode?.content)
|
|
930
934
|
update.description = descriptionNode.content.toString();
|
|
931
935
|
ev.emit('newsletter-settings.update', {
|
|
932
936
|
id: from,
|
|
@@ -935,14 +939,14 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
935
939
|
}
|
|
936
940
|
break;
|
|
937
941
|
case 'message':
|
|
938
|
-
const plaintextNode =
|
|
939
|
-
if (plaintextNode
|
|
942
|
+
const plaintextNode = getBinaryNodeChild(child, 'plaintext');
|
|
943
|
+
if (plaintextNode?.content) {
|
|
940
944
|
try {
|
|
941
945
|
const contentBuf = typeof plaintextNode.content === 'string'
|
|
942
946
|
? Buffer.from(plaintextNode.content, 'binary')
|
|
943
947
|
: Buffer.from(plaintextNode.content);
|
|
944
|
-
const messageProto =
|
|
945
|
-
const fullMessage =
|
|
948
|
+
const messageProto = proto.Message.decode(contentBuf);
|
|
949
|
+
const fullMessage = proto.WebMessageInfo.fromObject({
|
|
946
950
|
key: {
|
|
947
951
|
remoteJid: from,
|
|
948
952
|
id: child.attrs.message_id || child.attrs.server_id,
|
|
@@ -966,8 +970,8 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
966
970
|
}
|
|
967
971
|
// Handles mex newsletter notifications
|
|
968
972
|
async function handleMexNewsletterNotification(node) {
|
|
969
|
-
const mexNode =
|
|
970
|
-
if (!
|
|
973
|
+
const mexNode = getBinaryNodeChild(node, 'mex');
|
|
974
|
+
if (!mexNode?.content) {
|
|
971
975
|
logger.warn({ node }, 'Invalid mex newsletter notification');
|
|
972
976
|
return;
|
|
973
977
|
}
|
|
@@ -979,8 +983,8 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
979
983
|
logger.error({ err: error, node }, 'Failed to parse mex newsletter notification');
|
|
980
984
|
return;
|
|
981
985
|
}
|
|
982
|
-
const operation = data
|
|
983
|
-
const updates = data
|
|
986
|
+
const operation = data?.operation;
|
|
987
|
+
const updates = data?.updates;
|
|
984
988
|
if (!updates || !operation) {
|
|
985
989
|
logger.warn({ data }, 'Invalid mex newsletter notification content');
|
|
986
990
|
return;
|
|
@@ -1032,6 +1036,9 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
1032
1036
|
handleBadAck(node).catch(error => onUnexpectedError(error, 'handling bad ack'));
|
|
1033
1037
|
});
|
|
1034
1038
|
ev.on('call', ([call]) => {
|
|
1039
|
+
if (!call) {
|
|
1040
|
+
return;
|
|
1041
|
+
}
|
|
1035
1042
|
// missed call + group call notification message generation
|
|
1036
1043
|
if (call.status === 'timeout' || (call.status === 'offer' && call.isGroup)) {
|
|
1037
1044
|
const msg = {
|
|
@@ -1040,22 +1047,22 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
1040
1047
|
id: call.id,
|
|
1041
1048
|
fromMe: false
|
|
1042
1049
|
},
|
|
1043
|
-
messageTimestamp:
|
|
1050
|
+
messageTimestamp: unixTimestampSeconds(call.date)
|
|
1044
1051
|
};
|
|
1045
1052
|
if (call.status === 'timeout') {
|
|
1046
1053
|
if (call.isGroup) {
|
|
1047
1054
|
msg.messageStubType = call.isVideo
|
|
1048
|
-
?
|
|
1049
|
-
:
|
|
1055
|
+
? WAMessageStubType.CALL_MISSED_GROUP_VIDEO
|
|
1056
|
+
: WAMessageStubType.CALL_MISSED_GROUP_VOICE;
|
|
1050
1057
|
}
|
|
1051
1058
|
else {
|
|
1052
|
-
msg.messageStubType = call.isVideo ?
|
|
1059
|
+
msg.messageStubType = call.isVideo ? WAMessageStubType.CALL_MISSED_VIDEO : WAMessageStubType.CALL_MISSED_VOICE;
|
|
1053
1060
|
}
|
|
1054
1061
|
}
|
|
1055
1062
|
else {
|
|
1056
1063
|
msg.message = { call: { callKey: Buffer.from(call.id) } };
|
|
1057
1064
|
}
|
|
1058
|
-
const protoMsg =
|
|
1065
|
+
const protoMsg = proto.WebMessageInfo.fromObject(msg);
|
|
1059
1066
|
upsertMessage(protoMsg, call.offline ? 'append' : 'notify');
|
|
1060
1067
|
}
|
|
1061
1068
|
});
|
|
@@ -1074,4 +1081,4 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
1074
1081
|
requestPlaceholderResend
|
|
1075
1082
|
};
|
|
1076
1083
|
};
|
|
1077
|
-
|
|
1084
|
+
//# sourceMappingURL=messages-recv.js.map
|