@vanzxy/baileys 1.2.3 → 1.2.6
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/LICENSE +1 -0
- package/README.md +5 -3
- package/WAProto/index.js +0 -45
- package/lib/Socket/chats.js +37 -1
- package/lib/Socket/dugong.js +768 -0
- package/lib/Socket/index.js +6 -3
- package/lib/Socket/newsletter.js +96 -1
- package/lib/Utils/history.js +2 -16
- package/lib/Utils/messages.js +253 -30
- package/lib/WABinary/generic-utils.js +34 -5
- package/lib/index.js +2 -1
- package/package.json +2 -2
package/LICENSE
CHANGED
|
@@ -2,6 +2,7 @@ MIT License
|
|
|
2
2
|
|
|
3
3
|
Copyright (c) 2025 Rajeh Taher/WhiskeySockets
|
|
4
4
|
Copyright (c) 2026 Lia Wynn
|
|
5
|
+
Copyright (c) 2026 Vanzxy🍃 / VanzxyPrst🍃
|
|
5
6
|
|
|
6
7
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
8
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
# 🌿 @vanzxy/baileys
|
|
2
2
|
|
|
3
|
-
Enhanced Baileys fork by **Vanzxy** — built on top of `@itsliaaa/baileys` with
|
|
3
|
+
Enhanced Baileys fork by **Vanzxy🍃 (VanzxyPrst🍃)** — built on top of `@itsliaaa/baileys` with extended native flow button support, system-notification filtering, and other fixes for WhatsApp bot development.
|
|
4
4
|
|
|
5
5
|
## ✨ What's Different
|
|
6
6
|
|
|
7
|
-
### 🔧 Fixes
|
|
7
|
+
### 🔧 Fixes & Additions by Vanzxy🍃
|
|
8
8
|
|
|
9
9
|
- **Audio Group Status** — Audio in `groupStatus: true` now uses `groupStatusMessage` (v1) instead of `groupStatusMessageV2`. This fixes the black screen / *"versi WhatsApp tidak mendukung"* error on older WA versions when bots broadcast audio via `swgc`.
|
|
10
10
|
- **No "Lihat Saluran" Button** — Removed `mediaAnnotation` that auto-injected newsletter context into every image/video upload, causing an unwanted *"Lihat saluran"* button to appear on all media messages.
|
|
11
|
+
- **Extended Native Flow Buttons** — Added support for `cta_reminder`, `cta_cancel_reminder`, `address_message`, `send_location`, `catalog_message`, `mpm`, `otp_button`, `authentication_button`, `call_button`, `url_button`, `reply_button`, `card_message`, `order_details`, `order_status`, `review_and_pay`, `payment_status`, `payment_method`, `track_order`, `reorder`, `cancel_order`, `clear_chat`, `navigateToScreen`, `flow_action`, `voice_call`, `video_call_button` — fully additive, existing button types untouched.
|
|
12
|
+
- **System Notification Filtering** — Messages now carry an `isSystemNotification` flag (e.g. for E2E encryption notices, "business uses Meta service" notices) so bots can easily skip them without affecting normal message handling.
|
|
11
13
|
|
|
12
14
|
### ✅ Inherited from `@itsliaaa/baileys`
|
|
13
15
|
- Interactive messages (buttons, list, native flow, carousel)
|
|
@@ -56,4 +58,4 @@ Full credit to original maintainers:
|
|
|
56
58
|
- [purpshell](https://github.com/purpshell), [jlucaso1](https://github.com/jlucaso1), [adiwajshing](https://github.com/adiwajshing) — WhiskeySockets/Baileys
|
|
57
59
|
- [Lia Wynn (itsliaaa)](https://github.com/itsliaaa) — @itsliaaa/baileys
|
|
58
60
|
|
|
59
|
-
Fixes & fork by [
|
|
61
|
+
Fixes & fork by **Vanzxy🍃 (VanzxyPrst🍃)** — [github.com/vanzxy](https://github.com/vanzxy)
|
package/WAProto/index.js
CHANGED
|
@@ -115445,48 +115445,3 @@ export const proto = $root.proto = (() => {
|
|
|
115445
115445
|
})();
|
|
115446
115446
|
|
|
115447
115447
|
export { $root as default };
|
|
115448
|
-
|
|
115449
|
-
|
|
115450
|
-
// === VANZXY ADDED NEW FEATURES ===
|
|
115451
|
-
// Added feature: ShopStorefrontMessage
|
|
115452
|
-
// Added feature: quick_reply
|
|
115453
|
-
// Added feature: single_select
|
|
115454
|
-
// Added feature: cta_url
|
|
115455
|
-
// Added feature: cta_copy
|
|
115456
|
-
// Added feature: cta_call
|
|
115457
|
-
// Added feature: cta_reminder
|
|
115458
|
-
// Added feature: cta_cancel_reminder
|
|
115459
|
-
// Added feature: send_location
|
|
115460
|
-
// Added feature: address_message
|
|
115461
|
-
// Added feature: catalog_message
|
|
115462
|
-
// Added feature: mpm
|
|
115463
|
-
|
|
115464
|
-
// Added extra feature: copy_code
|
|
115465
|
-
// Added extra feature: clear_chat
|
|
115466
|
-
// Added extra feature: navigateToScreen
|
|
115467
|
-
// Added extra feature: card_message
|
|
115468
|
-
// Added extra feature: order_details
|
|
115469
|
-
// Added extra feature: order_status
|
|
115470
|
-
|
|
115471
|
-
|
|
115472
|
-
// === VANZXY ULTIMATE FULL BUTTONS SUPPORT ===
|
|
115473
|
-
// Supported All Button Feature: review_and_pay
|
|
115474
|
-
// Supported All Button Feature: payment_status
|
|
115475
|
-
// Supported All Button Feature: payment_method
|
|
115476
|
-
// Supported All Button Feature: track_order
|
|
115477
|
-
// Supported All Button Feature: reorder
|
|
115478
|
-
// Supported All Button Feature: cancel_order
|
|
115479
|
-
// Supported All Button Feature: otp_button
|
|
115480
|
-
// Supported All Button Feature: authentication_button
|
|
115481
|
-
// Supported All Button Feature: open_url
|
|
115482
|
-
// Supported All Button Feature: call_button
|
|
115483
|
-
// Supported All Button Feature: url_button
|
|
115484
|
-
// Supported All Button Feature: reply_button
|
|
115485
|
-
// Supported All Button Feature: list_reply
|
|
115486
|
-
// Supported All Button Feature: buttons_response
|
|
115487
|
-
// Supported All Button Feature: template_button_reply
|
|
115488
|
-
// Supported All Button Feature: interactive_response
|
|
115489
|
-
|
|
115490
|
-
// Anti-Error Component: buttonsReplyMessage
|
|
115491
|
-
// Anti-Error Component: hydratedTemplateButton
|
|
115492
|
-
// Anti-Error Component: externalAdReplyInfo
|
package/lib/Socket/chats.js
CHANGED
|
@@ -2,7 +2,7 @@ import NodeCache from '@cacheable/node-cache';
|
|
|
2
2
|
import { Boom } from '@hapi/boom';
|
|
3
3
|
import { proto } from '../../WAProto/index.js';
|
|
4
4
|
import { DEFAULT_CACHE_TTLS, HISTORY_SYNC_PAUSED_TIMEOUT_MS, PROCESSABLE_HISTORY_TYPES } from '../Defaults/index.js';
|
|
5
|
-
import { ALL_WA_PATCH_NAMES } from '../Types/index.js';
|
|
5
|
+
import { ALL_WA_PATCH_NAMES, WAMessageStubType } from '../Types/index.js';
|
|
6
6
|
import { SyncState } from '../Types/State.js';
|
|
7
7
|
import { chatModificationToAppPatch, decodePatches, decodeSyncdSnapshot, encodeSyncdPatch, ensureLTHashStateVersion, extractSyncdPatches, generateProfilePicture, getHistoryMsg, isAppStateSyncIrrecoverable, isMissingKeyError, MAX_SYNC_ATTEMPTS, newLTHashState, processSyncAction } from '../Utils/index.js';
|
|
8
8
|
import { makeMutex } from '../Utils/make-mutex.js';
|
|
@@ -929,7 +929,43 @@ export const makeChatsSocket = (config) => {
|
|
|
929
929
|
const executeInitQueries = async () => {
|
|
930
930
|
await Promise.all([fetchProps(), fetchBlocklist(), fetchPrivacySettings()]);
|
|
931
931
|
};
|
|
932
|
+
// Vanzxy@Changes --- Detect WhatsApp system/security notification messages
|
|
933
|
+
// (e.g. "Messages are end-to-end encrypted", "This business now uses a secure
|
|
934
|
+
// service from Meta") so consumers can filter them out without affecting any
|
|
935
|
+
// existing message types or behavior. This ONLY adds a flag, nothing is dropped.
|
|
936
|
+
const isWASystemNotification = (msg) => {
|
|
937
|
+
const content = msg?.message;
|
|
938
|
+
if (!content)
|
|
939
|
+
return false;
|
|
940
|
+
// E2E / business-encryption notices arrive as protocolMessage with these types
|
|
941
|
+
const protoType = content.protocolMessage?.type;
|
|
942
|
+
if (protoType === proto.Message.ProtocolMessage.Type.HISTORY_SYNC_NOTIFICATION ||
|
|
943
|
+
protoType === proto.Message.ProtocolMessage.Type.APP_STATE_SYNC_KEY_SHARE ||
|
|
944
|
+
protoType === proto.Message.ProtocolMessage.Type.PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE ||
|
|
945
|
+
protoType === proto.Message.ProtocolMessage.Type.LID_MIGRATION_MAPPING_SYNC) {
|
|
946
|
+
return true;
|
|
947
|
+
}
|
|
948
|
+
// Generic stub-type system notices (no real content, just a stub event)
|
|
949
|
+
if (msg.messageStubType && !content.conversation && !content.extendedTextMessage) {
|
|
950
|
+
const stub = msg.messageStubType;
|
|
951
|
+
const SYSTEM_STUB_TYPES = new Set([
|
|
952
|
+
WAMessageStubType.E2E_DEVICE_CHANGED,
|
|
953
|
+
WAMessageStubType.E2E_ENCRYPTED,
|
|
954
|
+
WAMessageStubType.E2E_IDENTITY_CHANGED,
|
|
955
|
+
WAMessageStubType.CIPHERTEXT,
|
|
956
|
+
WAMessageStubType.BIZ_PRIVACY_MODE_TO_BSP,
|
|
957
|
+
WAMessageStubType.BIZ_PRIVACY_MODE_TO_FB
|
|
958
|
+
]);
|
|
959
|
+
if (SYSTEM_STUB_TYPES.has(stub))
|
|
960
|
+
return true;
|
|
961
|
+
}
|
|
962
|
+
return false;
|
|
963
|
+
};
|
|
932
964
|
const upsertMessage = ev.createBufferedFunction(async (msg, type) => {
|
|
965
|
+
// Vanzxy@Changes --- Annotate msg with isSystemNotification flag (additive only)
|
|
966
|
+
if (isWASystemNotification(msg)) {
|
|
967
|
+
msg.isSystemNotification = true;
|
|
968
|
+
}
|
|
933
969
|
ev.emit('messages.upsert', { messages: [msg], type });
|
|
934
970
|
if (!!msg.pushName) {
|
|
935
971
|
let jid = msg.key.fromMe ? authState.creds.me.id : msg.key.participant || msg.key.remoteJid;
|