amiudmodz 4.0.5 → 4.1.2
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/README.md +130 -0
- package/lib/Defaults/index.js +9 -4
- package/lib/Socket/Client/web-socket-client.js +8 -1
- package/lib/Socket/groupStatus.js +51 -41
- package/lib/Socket/messages-send.js +35 -40
- package/lib/Socket/newsletter.js +406 -85
- package/lib/Socket/socket.js +10 -3
- package/lib/Utils/auth-utils.js +9 -1
- package/lib/Utils/event-buffer.js +9 -12
- package/lib/Utils/make-mutex.js +8 -13
- package/lib/Utils/noise-handler.js +21 -12
- package/package.json +11 -1
|
@@ -68,7 +68,9 @@ const makeNoiseHandler = ({ keyPair: { private: privateKey, public: publicKey },
|
|
|
68
68
|
let writeCounter = 0;
|
|
69
69
|
let isFinished = false;
|
|
70
70
|
let sentIntro = false;
|
|
71
|
-
|
|
71
|
+
|
|
72
|
+
let inChunks = [];
|
|
73
|
+
let inBytesLength = 0;
|
|
72
74
|
authenticate(NOISE_HEADER);
|
|
73
75
|
authenticate(publicKey);
|
|
74
76
|
return {
|
|
@@ -128,26 +130,33 @@ const makeNoiseHandler = ({ keyPair: { private: privateKey, public: publicKey },
|
|
|
128
130
|
decodeFrame: (newData, onFrame) => {
|
|
129
131
|
var _a;
|
|
130
132
|
|
|
133
|
+
inChunks.push(newData);
|
|
134
|
+
inBytesLength += newData.length;
|
|
135
|
+
logger.trace(`recv ${newData.length} bytes, total recv ${inBytesLength} bytes`);
|
|
131
136
|
|
|
137
|
+
while (inBytesLength >= 3) {
|
|
132
138
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
139
|
+
if (inChunks.length > 1) {
|
|
140
|
+
const combined = Buffer.concat(inChunks);
|
|
141
|
+
inChunks = [combined];
|
|
142
|
+
}
|
|
143
|
+
const inBytes = inChunks[0];
|
|
144
|
+
const size = (inBytes.readUInt8(0) << 16) | inBytes.readUInt16BE(1);
|
|
145
|
+
if (inBytesLength < size + 3) {
|
|
146
|
+
break;
|
|
136
147
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
inBytes = inBytes.slice(size + 3);
|
|
148
|
+
|
|
149
|
+
let frame = inBytes.subarray(3, size + 3);
|
|
150
|
+
|
|
151
|
+
const remaining = inBytes.subarray(size + 3);
|
|
152
|
+
inChunks = remaining.length > 0 ? [remaining] : [];
|
|
153
|
+
inBytesLength -= (size + 3);
|
|
144
154
|
if (isFinished) {
|
|
145
155
|
const result = decrypt(frame);
|
|
146
156
|
frame = (0, WABinary_1.decodeBinaryNode)(result);
|
|
147
157
|
}
|
|
148
158
|
logger.trace({ msg: (_a = frame === null || frame === void 0 ? void 0 : frame.attrs) === null || _a === void 0 ? void 0 : _a.id }, 'recv frame');
|
|
149
159
|
onFrame(frame);
|
|
150
|
-
size = getBytesSize();
|
|
151
160
|
}
|
|
152
161
|
}
|
|
153
162
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "amiudmodz",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.2",
|
|
4
|
+
"description": "WhatsApp Baileys mod Powered by UDMODZ",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"whatsapp",
|
|
7
|
+
"baileys",
|
|
8
|
+
"udmodz",
|
|
9
|
+
"bot",
|
|
10
|
+
"whatsapp-api",
|
|
11
|
+
"whatsapp-web",
|
|
12
|
+
"badiys"
|
|
13
|
+
],
|
|
4
14
|
"main": "lib/index.js",
|
|
5
15
|
"types": "lib/index.d.ts",
|
|
6
16
|
"files": [
|