whalibmob 5.5.39 → 5.5.40

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.
@@ -499,8 +499,34 @@ function decodeMessageContainer(buf) {
499
499
  try {
500
500
  const pm = _decodeFields(f[12]);
501
501
  const pmType = pm[2];
502
- const typeNames = { 0: 'revoke', 3: 'ephemeral', 10: 'app_state_sync' };
503
- msgResult = { type: 'protocol', subtype: typeNames[pmType] || String(pmType) };
502
+ const typeNames = {
503
+ 0: 'revoke',
504
+ 3: 'ephemeral',
505
+ 5: 'app_state_sync_key_share',
506
+ 6: 'history_sync',
507
+ 10: 'app_state_sync'
508
+ };
509
+ const subtype = typeNames[pmType] || String(pmType);
510
+ msgResult = { type: 'protocol', subtype };
511
+
512
+ // ── HISTORY_SYNC_NOTIFICATION (pmType=6) ─────────────────────────────
513
+ // ProtocolMessage field 6 holds the HistorySyncNotification bytes.
514
+ if (pmType === 6 && pm[6] && Buffer.isBuffer(pm[6])) {
515
+ try {
516
+ const { decodeHistorySyncNotification } = require('../HistorySyncHandler');
517
+ msgResult.historySyncNotification = decodeHistorySyncNotification(pm[6]);
518
+ } catch (_hse) {}
519
+ }
520
+
521
+ // ── APP_STATE_SYNC_KEY_SHARE (pmType=5) ──────────────────────────────
522
+ // ProtocolMessage field 7 holds the AppStateSyncKeyShare bytes.
523
+ if (pmType === 5 && pm[7] && Buffer.isBuffer(pm[7])) {
524
+ try {
525
+ const { decodeAppStateSyncKeyShare } = require('../HistorySyncHandler');
526
+ msgResult.appStateSyncKeyShare = decodeAppStateSyncKeyShare(pm[7]);
527
+ } catch (_ase) {}
528
+ }
529
+
504
530
  } catch (_) { msgResult = { type: 'protocol', subtype: 'unknown' }; }
505
531
  }
506
532
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  {
3
3
  "name": "whalibmob",
4
- "version": "5.5.39",
4
+ "version": "5.5.40",
5
5
  "description": "WhatsApp library for interaction with WhatsApp Mobile API no web",
6
6
  "author": "Kunboruto50",
7
7
  "main": "index.js",