davexbaileys 1.4.3 → 1.4.4
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/lib/Defaults/index.js
CHANGED
|
@@ -3,7 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DEFAULT_CACHE_TTLS = exports.INITIAL_PREKEY_COUNT = exports.MIN_PREKEY_COUNT = exports.MEDIA_KEYS = exports.MEDIA_HKDF_KEY_MAPPING = exports.MEDIA_PATH_MAP = exports.DEFAULT_CONNECTION_CONFIG = exports.PROCESSABLE_HISTORY_TYPES = exports.WA_CERT_DETAILS = exports.URL_REGEX = exports.NOISE_WA_HEADER = exports.KEY_BUNDLE_TYPE = exports.DICT_VERSION = exports.NOISE_MODE = exports.WA_DEFAULT_EPHEMERAL = exports.PHONE_CONNECTION_CB = exports.DEF_TAG_PREFIX = exports.DEF_CALLBACK_PREFIX = exports.DEFAULT_ORIGIN = exports.UNAUTHORIZED_CODES = void 0;
|
|
6
|
+
exports.DEFAULT_CACHE_TTLS = exports.INITIAL_PREKEY_COUNT = exports.MIN_PREKEY_COUNT = exports.MEDIA_KEYS = exports.MEDIA_HKDF_KEY_MAPPING = exports.MEDIA_PATH_MAP = exports.DEFAULT_CONNECTION_CONFIG = exports.PROCESSABLE_HISTORY_TYPES = exports.WA_CERT_DETAILS = exports.URL_REGEX = exports.NOISE_WA_HEADER = exports.KEY_BUNDLE_TYPE = exports.DICT_VERSION = exports.NOISE_MODE = exports.WA_DEFAULT_EPHEMERAL = exports.PHONE_CONNECTION_CB = exports.DEF_TAG_PREFIX = exports.DEF_CALLBACK_PREFIX = exports.DEFAULT_ORIGIN = exports.UNAUTHORIZED_CODES = exports.WA_ADV_HOSTED_DEVICE_SIG_PREFIX = exports.WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX = exports.WA_ADV_DEVICE_SIG_PREFIX = exports.WA_ADV_ACCOUNT_SIG_PREFIX = exports.CALL_VIDEO_PREFIX = exports.CALL_AUDIO_PREFIX = void 0;
|
|
7
|
+
// Call link prefixes
|
|
8
|
+
exports.CALL_AUDIO_PREFIX = 'https://call.whatsapp.com/voice/';
|
|
9
|
+
exports.CALL_VIDEO_PREFIX = 'https://call.whatsapp.com/video/';
|
|
10
|
+
// WhatsApp ADV (Advanced) signature prefixes used during pairing/auth
|
|
11
|
+
exports.WA_ADV_ACCOUNT_SIG_PREFIX = Buffer.from([6, 0]);
|
|
12
|
+
exports.WA_ADV_DEVICE_SIG_PREFIX = Buffer.from([6, 1]);
|
|
13
|
+
exports.WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX = Buffer.from([6, 2]);
|
|
14
|
+
exports.WA_ADV_HOSTED_DEVICE_SIG_PREFIX = Buffer.from([6, 3]);
|
|
7
15
|
const WAProto_1 = require("../../WAProto");
|
|
8
16
|
const libsignal_1 = require("../Signal/libsignal");
|
|
9
17
|
const Utils_1 = require("../Utils");
|
|
@@ -631,13 +631,16 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
631
631
|
return;
|
|
632
632
|
}
|
|
633
633
|
const msgId = node.attrs.id;
|
|
634
|
-
|
|
634
|
+
// Include remoteJid in dedup key so messages from different chats with
|
|
635
|
+
// the same ID don't cancel each other — root cause of double responses.
|
|
636
|
+
const dedupKey = msgId ? `${msgId}:${node.attrs.from || ''}` : undefined;
|
|
637
|
+
if (dedupKey && processedMsgIds.get(dedupKey)) {
|
|
635
638
|
logger.debug({ msgId }, 'skipping duplicate message');
|
|
636
639
|
await sendMessageAck(node);
|
|
637
640
|
return;
|
|
638
641
|
}
|
|
639
|
-
if (
|
|
640
|
-
processedMsgIds.set(
|
|
642
|
+
if (dedupKey) {
|
|
643
|
+
processedMsgIds.set(dedupKey, true);
|
|
641
644
|
}
|
|
642
645
|
const encNode = (0, WABinary_1.getBinaryNodeChild)(node, 'enc');
|
|
643
646
|
// TODO: temporary fix for crashes and issues resulting of failed msmsg decryption
|
package/package.json
CHANGED