@periskope/baileys 6.7.15-alpha.4 → 6.7.15-alpha.6
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/Utils/chat-utils.js
CHANGED
|
@@ -69,9 +69,9 @@ const makeLtHashGenerator = ({ indexValueMap, hash }) => {
|
|
|
69
69
|
subBuffs.push(new Uint8Array(prevOp.valueMac).buffer);
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
|
-
finish: () => {
|
|
72
|
+
finish: async () => {
|
|
73
73
|
const hashArrayBuffer = new Uint8Array(hash).buffer;
|
|
74
|
-
const result = lt_hash_1.LT_HASH_ANTI_TAMPERING.subtractThenAdd(hashArrayBuffer, addBuffs, subBuffs);
|
|
74
|
+
const result = await lt_hash_1.LT_HASH_ANTI_TAMPERING.subtractThenAdd(hashArrayBuffer, addBuffs, subBuffs);
|
|
75
75
|
const buffer = Buffer.from(result);
|
|
76
76
|
return {
|
|
77
77
|
hash: buffer,
|
|
@@ -121,7 +121,7 @@ const encodeSyncdPatch = async ({ type, index, syncAction, apiVersion, operation
|
|
|
121
121
|
// update LT hash
|
|
122
122
|
const generator = makeLtHashGenerator(state);
|
|
123
123
|
generator.mix({ indexMac, valueMac, operation });
|
|
124
|
-
Object.assign(state, generator.finish());
|
|
124
|
+
Object.assign(state, await generator.finish());
|
|
125
125
|
state.version += 1;
|
|
126
126
|
const snapshotMac = generateSnapshotMac(state.hash, state.version, type, keyValue.snapshotMacKey);
|
|
127
127
|
const patch = {
|
|
@@ -72,7 +72,7 @@ const getUrlInfo = async (text, opts = {
|
|
|
72
72
|
return false;
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
|
-
headers: opts.fetchOpts
|
|
75
|
+
headers: { ...(opts.fetchOpts.headers || {}), "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36", }
|
|
76
76
|
});
|
|
77
77
|
if (info && 'title' in info && info.title) {
|
|
78
78
|
const [image] = info.images;
|
package/lib/Utils/lt-hash.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
declare class d {
|
|
2
2
|
salt: string;
|
|
3
3
|
constructor(e: string);
|
|
4
|
-
add(e: any, t: any): any
|
|
5
|
-
subtract(e: any, t: any): any
|
|
6
|
-
subtractThenAdd(e: any, t: any, r: any): any
|
|
4
|
+
add(e: any, t: any): Promise<any>;
|
|
5
|
+
subtract(e: any, t: any): Promise<any>;
|
|
6
|
+
subtractThenAdd(e: any, t: any, r: any): Promise<any>;
|
|
7
7
|
_addSingle(e: any, t: any): Promise<ArrayBuffer>;
|
|
8
8
|
_subtractSingle(e: any, t: any): Promise<ArrayBuffer>;
|
|
9
9
|
performPointwiseWithOverflow(e: any, t: any, r: any): ArrayBuffer;
|
package/lib/Utils/lt-hash.js
CHANGED
|
@@ -12,23 +12,23 @@ class d {
|
|
|
12
12
|
constructor(e) {
|
|
13
13
|
this.salt = e;
|
|
14
14
|
}
|
|
15
|
-
add(e, t) {
|
|
15
|
+
async add(e, t) {
|
|
16
16
|
var r = this;
|
|
17
17
|
for (const item of t) {
|
|
18
|
-
e = r._addSingle(e, item);
|
|
18
|
+
e = await r._addSingle(e, item);
|
|
19
19
|
}
|
|
20
20
|
return e;
|
|
21
21
|
}
|
|
22
|
-
subtract(e, t) {
|
|
22
|
+
async subtract(e, t) {
|
|
23
23
|
var r = this;
|
|
24
24
|
for (const item of t) {
|
|
25
|
-
e = r._subtractSingle(e, item);
|
|
25
|
+
e = await r._subtractSingle(e, item);
|
|
26
26
|
}
|
|
27
27
|
return e;
|
|
28
28
|
}
|
|
29
|
-
subtractThenAdd(e, t, r) {
|
|
29
|
+
async subtractThenAdd(e, t, r) {
|
|
30
30
|
var n = this;
|
|
31
|
-
return n.add(n.subtract(e, r), t);
|
|
31
|
+
return n.add(await n.subtract(e, r), t);
|
|
32
32
|
}
|
|
33
33
|
async _addSingle(e, t) {
|
|
34
34
|
var r = this;
|