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 <unavailable> placeholders.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Renato Alcara
2026-04-12 23:43:17 -03:00
parent a74fbb08a6
commit 313f304ddf
+17 -1
View File
@@ -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) => {