@ryuu-reinzz/baileys 5.0.0 → 5.0.3
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/Signal/libsignal.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @ts-ignore
|
|
2
2
|
import * as libsignal from 'libsignal';
|
|
3
3
|
// @ts-ignore
|
|
4
|
-
import
|
|
4
|
+
import signals from 'libsignal/src/protobufs.js';
|
|
5
5
|
import { LRUCache } from 'lru-cache';
|
|
6
6
|
import { generateSignalPubKey } from '../Utils/index.js';
|
|
7
7
|
import { isHostedLidUser, isHostedPnUser, isLidUser, isPnUser, jidDecode, transferDevice, WAJIDDomains } from '../WABinary/index.js';
|
|
@@ -10,6 +10,7 @@ import { SenderKeyRecord } from './Group/sender-key-record.js';
|
|
|
10
10
|
import { GroupCipher, GroupSessionBuilder, SenderKeyDistributionMessage } from './Group/index.js';
|
|
11
11
|
import { LIDMappingStore } from './lid-mapping.js';
|
|
12
12
|
/** Extract identity key from PreKeyWhisperMessage for identity change detection */
|
|
13
|
+
const { PreKeyWhisperMessage } = signals;
|
|
13
14
|
function extractIdentityFromPkmsg(ciphertext) {
|
|
14
15
|
try {
|
|
15
16
|
if (!ciphertext || ciphertext.length < 2) {
|
|
@@ -1223,20 +1223,7 @@ export const makeMessagesSocket = (config) => {
|
|
|
1223
1223
|
};
|
|
1224
1224
|
const waUploadToServer = getWAUploadToServer(config, refreshMediaConn);
|
|
1225
1225
|
const waitForMsgMediaUpdate = bindWaitForEvent(ev, 'messages.media-update');
|
|
1226
|
-
|
|
1227
|
-
waUploadToServer: {
|
|
1228
|
-
value: waUploadToServer,
|
|
1229
|
-
writable: false,
|
|
1230
|
-
enumerable: false,
|
|
1231
|
-
configurable: true
|
|
1232
|
-
},
|
|
1233
|
-
relayMessage: {
|
|
1234
|
-
value: relayMessage,
|
|
1235
|
-
writable: false,
|
|
1236
|
-
enumerable: false,
|
|
1237
|
-
configurable: true
|
|
1238
|
-
}
|
|
1239
|
-
});
|
|
1226
|
+
Object.assign(sock, { waUploadToServer, relayMessage });
|
|
1240
1227
|
registerSocketEndHandler(() => {
|
|
1241
1228
|
if (!config.userDevicesCache && userDevicesCache.close) {
|
|
1242
1229
|
userDevicesCache.close();
|