@elfhkry666/baileys 0.3.21 → 0.3.23
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/Socket/socket.js +53 -40
- package/lib/Utils/browser-utils.js +2 -2
- package/lib/Utils/generics.js +1 -1
- package/package.json +1 -1
package/lib/Socket/socket.js
CHANGED
|
@@ -601,52 +601,65 @@ export const makeSocket = (config) => {
|
|
|
601
601
|
name: '~'
|
|
602
602
|
};
|
|
603
603
|
ev.emit('creds.update', authState.creds);
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
content: [
|
|
613
|
-
{
|
|
614
|
-
tag: 'link_code_companion_reg',
|
|
604
|
+
|
|
605
|
+
let retryCount = 0;
|
|
606
|
+
const maxRetries = 3;
|
|
607
|
+
|
|
608
|
+
while (retryCount < maxRetries) {
|
|
609
|
+
try {
|
|
610
|
+
await sendNode({
|
|
611
|
+
tag: 'iq',
|
|
615
612
|
attrs: {
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
613
|
+
to: S_WHATSAPP_NET,
|
|
614
|
+
type: 'set',
|
|
615
|
+
id: generateMessageTag(),
|
|
616
|
+
xmlns: 'md'
|
|
619
617
|
},
|
|
620
618
|
content: [
|
|
621
619
|
{
|
|
622
|
-
tag: '
|
|
623
|
-
attrs: {
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
620
|
+
tag: 'link_code_companion_reg',
|
|
621
|
+
attrs: {
|
|
622
|
+
jid: authState.creds.me.id,
|
|
623
|
+
stage: 'companion_hello',
|
|
624
|
+
should_show_push_notification: 'true'
|
|
625
|
+
},
|
|
626
|
+
content: [
|
|
627
|
+
{
|
|
628
|
+
tag: 'link_code_pairing_wrapped_companion_ephemeral_pub',
|
|
629
|
+
attrs: {},
|
|
630
|
+
content: await generatePairingKey()
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
tag: 'companion_server_auth_key_pub',
|
|
634
|
+
attrs: {},
|
|
635
|
+
content: authState.creds.noiseKey.public
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
tag: 'companion_platform_id',
|
|
639
|
+
attrs: {},
|
|
640
|
+
content: getCompanionPlatformId(browser)
|
|
641
|
+
},
|
|
642
|
+
{
|
|
643
|
+
tag: 'companion_platform_display',
|
|
644
|
+
attrs: {},
|
|
645
|
+
content: `${browser[1]} (${browser[0]})`
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
tag: 'link_code_pairing_nonce',
|
|
649
|
+
attrs: {},
|
|
650
|
+
content: '0'
|
|
651
|
+
}
|
|
652
|
+
]
|
|
645
653
|
}
|
|
646
654
|
]
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
|
|
655
|
+
});
|
|
656
|
+
break;
|
|
657
|
+
} catch (err) {
|
|
658
|
+
retryCount++;
|
|
659
|
+
if (retryCount >= maxRetries) throw err;
|
|
660
|
+
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
661
|
+
}
|
|
662
|
+
}
|
|
650
663
|
return authState.creds.pairingCode;
|
|
651
664
|
};
|
|
652
665
|
async function generatePairingKey() {
|
|
@@ -14,8 +14,8 @@ const PLATFORM_MAP = {
|
|
|
14
14
|
netbsd: undefined
|
|
15
15
|
};
|
|
16
16
|
export const Browsers = {
|
|
17
|
-
ubuntu: browser => ['Ubuntu', browser, '
|
|
18
|
-
macOS: browser => ['Mac OS', browser, '14.
|
|
17
|
+
ubuntu: browser => ['Ubuntu', browser, '24.04.0'],
|
|
18
|
+
macOS: browser => ['Mac OS', browser, '14.5.0'],
|
|
19
19
|
baileys: browser => ['Baileys', browser, '6.5.0'],
|
|
20
20
|
windows: browser => ['Windows', browser, '10.0.22631'],
|
|
21
21
|
/** The appropriate browser based on your OS & release */
|
package/lib/Utils/generics.js
CHANGED
|
@@ -179,7 +179,7 @@ export const bindWaitForConnectionUpdate = (ev) => bindWaitForEvent(ev, 'connect
|
|
|
179
179
|
* Use to ensure your WA connection is always on the latest version
|
|
180
180
|
*/
|
|
181
181
|
export const fetchLatestBaileysVersion = async (options = {}) => {
|
|
182
|
-
const URL = 'https://raw.githubusercontent.com/
|
|
182
|
+
const URL = 'https://raw.githubusercontent.com/Fhkryxv-0/Baileys/main/lib/Defaults/index.js';
|
|
183
183
|
try {
|
|
184
184
|
const response = await fetch(URL, {
|
|
185
185
|
dispatcher: options.dispatcher,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elfhkry666/baileys",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.23",
|
|
4
4
|
"description": "KaelPedia fork of Baileys v7 — newsletter media fixes, interactive messages, albums, and extra message types. Based on @itsliaaa/baileys v0.3.18.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|