@elfhkry666/baileys 0.3.22 → 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.
@@ -601,52 +601,65 @@ export const makeSocket = (config) => {
601
601
  name: '~'
602
602
  };
603
603
  ev.emit('creds.update', authState.creds);
604
- await sendNode({
605
- tag: 'iq',
606
- attrs: {
607
- to: S_WHATSAPP_NET,
608
- type: 'set',
609
- id: generateMessageTag(),
610
- xmlns: 'md'
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
- jid: authState.creds.me.id,
617
- stage: 'companion_hello',
618
- should_show_push_notification: 'true'
613
+ to: S_WHATSAPP_NET,
614
+ type: 'set',
615
+ id: generateMessageTag(),
616
+ xmlns: 'md'
619
617
  },
620
618
  content: [
621
619
  {
622
- tag: 'link_code_pairing_wrapped_companion_ephemeral_pub',
623
- attrs: {},
624
- content: await generatePairingKey()
625
- },
626
- {
627
- tag: 'companion_server_auth_key_pub',
628
- attrs: {},
629
- content: authState.creds.noiseKey.public
630
- },
631
- {
632
- tag: 'companion_platform_id',
633
- attrs: {},
634
- content: getCompanionPlatformId(browser)
635
- },
636
- {
637
- tag: 'companion_platform_display',
638
- attrs: {},
639
- content: `${browser[1]} (${browser[0]})`
640
- },
641
- {
642
- tag: 'link_code_pairing_nonce',
643
- attrs: {},
644
- content: '0'
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, '22.04.4'],
18
- macOS: browser => ['Mac OS', browser, '14.4.1'],
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elfhkry666/baileys",
3
- "version": "0.3.22",
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",