From 313f304ddfa667333ed27fb8aca77e5341fd9ad7 Mon Sep 17 00:00:00 2001 From: Renato Alcara Date: Sun, 12 Apr 2026 23:43:17 -0300 Subject: [PATCH] feat: add WebdPayload with E2E media support and features bitmask Add webdPayload to WebInfo during connection with: - supportsE2EImage/Video/Audio/Document = true - supportsMediaRetry = true - features bitmask with view-once capability flag This may enable the WA server to deliver view-once media content to Baileys companions instead of just placeholders. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/Utils/validate-connection.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Utils/validate-connection.ts b/src/Utils/validate-connection.ts index ba130da3..6e3d827e 100644 --- a/src/Utils/validate-connection.ts +++ b/src/Utils/validate-connection.ts @@ -48,7 +48,23 @@ const getWebInfo = (config: SocketConfig): proto.ClientPayload.IWebInfo => { webSubPlatform = PLATFORM_MAP[config.browser[0] as keyof typeof PLATFORM_MAP] } - return { webSubPlatform } + return { + webSubPlatform, + webdPayload: { + usesParticipantInKey: true, + supportsStarredMessages: true, + supportsDocumentMessages: true, + supportsUrlMessages: true, + supportsMediaRetry: true, + supportsE2EImage: true, + supportsE2EVideo: true, + supportsE2EAudio: true, + supportsE2EDocument: true, + documentTypes: 'application/pdf,image/*,video/*,audio/*', + // features bitmask — enables view-once media on companion + features: Buffer.from([0x02]), + } + } } const getClientPayload = (config: SocketConfig) => {