feat: add support for hidden-voter-names polls (pollCreationMessageV6) - #2725
feat: add support for hidden-voter-names polls (pollCreationMessageV6)#2725zeative wants to merge 1 commit into
Conversation
- Add pollCreationMessageV6 message type (field 119 in Message) - Add hideVoterNames field (field 10 in PollCreationMessage) - Enables creating polls where voter names are hidden - Reverse-engineered from live WhatsApp implementation - Tested on official WhatsApp client Proof: https://github.com/zeative/zaileys Patch: https://github.com/zeative/zaileys/blob/main/patches/baileys.patch Tests: All 2513 tests passing in zaileys
|
Thanks for opening this pull request and contributing to the project! The next step is for the maintainers to review your changes. If everything looks good, it will be approved and merged into the main branch. In the meantime, anyone in the community is encouraged to test this pull request and provide feedback. ✅ How to confirm it worksIf you’ve tested this PR, please comment below with: This helps us speed up the review and merge process. 📦 To test this PR locally:If you encounter any issues or have feedback, feel free to comment as well. |
📝 WalkthroughWalkthroughThe poll protobuf schema now supports ChangesPoll hidden-voter fields
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
4 issues found across 3 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="WAProto/WAProto.proto">
<violation number="1" location="WAProto/WAProto.proto:2162">
P2: This directly edits a generated protobuf binding, bypassing the repository’s required generation workflow. Regenerating from the authoritative proto-extraction source is needed so the schema and generated bindings remain reproducible and consistent.</violation>
<violation number="2" location="WAProto/WAProto.proto:2162">
P1: Messages using `pollCreationMessageV6` are sent with the generic `text` stanza type because `getMessageType()` does not recognize the new field. Including the V6 field in the poll classification, alongside the existing V2/V3 fields, would keep the wire payload and stanza metadata consistent.</violation>
<violation number="3" location="WAProto/WAProto.proto:2162">
P2: Vote aggregation does not recognize V6 poll messages, so selected options from an incoming hidden-voter-names poll are returned as `Unknown`. Including V6 in the option lookup keeps the existing poll-vote helper functional for the new message variant.</violation>
<violation number="4" location="WAProto/WAProto.proto:3240">
P1: The public poll API still has no way to create a V6 poll: `PollMessageOptions` does not expose `hideVoterNames`, and `generateWAMessageContent()` never selects `pollCreationMessageV6`. Wiring the option into the poll content and choosing V6 when it is enabled would make the advertised feature usable.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| optional PollCreationMessage pollCreationMessageV5 = 111; | ||
| optional NewsletterFollowerInviteMessage newsletterFollowerInviteMessageV2 = 113; | ||
| optional PollResultSnapshotMessage pollResultSnapshotMessageV3 = 114; | ||
| optional PollCreationMessage pollCreationMessageV6 = 119; // hidden-voter-names poll variant (reverse-engineered, not in official WA proto docs) |
There was a problem hiding this comment.
P1: Messages using pollCreationMessageV6 are sent with the generic text stanza type because getMessageType() does not recognize the new field. Including the V6 field in the poll classification, alongside the existing V2/V3 fields, would keep the wire payload and stanza metadata consistent.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At WAProto/WAProto.proto, line 2162:
<comment>Messages using `pollCreationMessageV6` are sent with the generic `text` stanza type because `getMessageType()` does not recognize the new field. Including the V6 field in the poll classification, alongside the existing V2/V3 fields, would keep the wire payload and stanza metadata consistent.</comment>
<file context>
@@ -2159,6 +2159,7 @@ message Message {
optional PollCreationMessage pollCreationMessageV5 = 111;
optional NewsletterFollowerInviteMessage newsletterFollowerInviteMessageV2 = 113;
optional PollResultSnapshotMessage pollResultSnapshotMessageV3 = 114;
+ optional PollCreationMessage pollCreationMessageV6 = 119; // hidden-voter-names poll variant (reverse-engineered, not in official WA proto docs)
message AlbumMessage {
optional uint32 expectedImageCount = 2;
</file context>
| optional Message.PollContentType pollContentType = 6; | ||
| optional Message.PollType pollType = 7; | ||
| optional Option correctAnswer = 8; | ||
| optional bool hideVoterNames = 10; // reverse-engineered: true when the poll creator hid voter names |
There was a problem hiding this comment.
P1: The public poll API still has no way to create a V6 poll: PollMessageOptions does not expose hideVoterNames, and generateWAMessageContent() never selects pollCreationMessageV6. Wiring the option into the poll content and choosing V6 when it is enabled would make the advertised feature usable.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At WAProto/WAProto.proto, line 3240:
<comment>The public poll API still has no way to create a V6 poll: `PollMessageOptions` does not expose `hideVoterNames`, and `generateWAMessageContent()` never selects `pollCreationMessageV6`. Wiring the option into the poll content and choosing V6 when it is enabled would make the advertised feature usable.</comment>
<file context>
@@ -3236,6 +3237,7 @@ message Message {
optional Message.PollContentType pollContentType = 6;
optional Message.PollType pollType = 7;
optional Option correctAnswer = 8;
+ optional bool hideVoterNames = 10; // reverse-engineered: true when the poll creator hid voter names
message Option {
optional string optionName = 1;
</file context>
| optional PollCreationMessage pollCreationMessageV5 = 111; | ||
| optional NewsletterFollowerInviteMessage newsletterFollowerInviteMessageV2 = 113; | ||
| optional PollResultSnapshotMessage pollResultSnapshotMessageV3 = 114; | ||
| optional PollCreationMessage pollCreationMessageV6 = 119; // hidden-voter-names poll variant (reverse-engineered, not in official WA proto docs) |
There was a problem hiding this comment.
P2: This directly edits a generated protobuf binding, bypassing the repository’s required generation workflow. Regenerating from the authoritative proto-extraction source is needed so the schema and generated bindings remain reproducible and consistent.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At WAProto/WAProto.proto, line 2162:
<comment>This directly edits a generated protobuf binding, bypassing the repository’s required generation workflow. Regenerating from the authoritative proto-extraction source is needed so the schema and generated bindings remain reproducible and consistent.</comment>
<file context>
@@ -2159,6 +2159,7 @@ message Message {
optional PollCreationMessage pollCreationMessageV5 = 111;
optional NewsletterFollowerInviteMessage newsletterFollowerInviteMessageV2 = 113;
optional PollResultSnapshotMessage pollResultSnapshotMessageV3 = 114;
+ optional PollCreationMessage pollCreationMessageV6 = 119; // hidden-voter-names poll variant (reverse-engineered, not in official WA proto docs)
message AlbumMessage {
optional uint32 expectedImageCount = 2;
</file context>
| optional PollCreationMessage pollCreationMessageV5 = 111; | ||
| optional NewsletterFollowerInviteMessage newsletterFollowerInviteMessageV2 = 113; | ||
| optional PollResultSnapshotMessage pollResultSnapshotMessageV3 = 114; | ||
| optional PollCreationMessage pollCreationMessageV6 = 119; // hidden-voter-names poll variant (reverse-engineered, not in official WA proto docs) |
There was a problem hiding this comment.
P2: Vote aggregation does not recognize V6 poll messages, so selected options from an incoming hidden-voter-names poll are returned as Unknown. Including V6 in the option lookup keeps the existing poll-vote helper functional for the new message variant.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At WAProto/WAProto.proto, line 2162:
<comment>Vote aggregation does not recognize V6 poll messages, so selected options from an incoming hidden-voter-names poll are returned as `Unknown`. Including V6 in the option lookup keeps the existing poll-vote helper functional for the new message variant.</comment>
<file context>
@@ -2159,6 +2159,7 @@ message Message {
optional PollCreationMessage pollCreationMessageV5 = 111;
optional NewsletterFollowerInviteMessage newsletterFollowerInviteMessageV2 = 113;
optional PollResultSnapshotMessage pollResultSnapshotMessageV3 = 114;
+ optional PollCreationMessage pollCreationMessageV6 = 119; // hidden-voter-names poll variant (reverse-engineered, not in official WA proto docs)
message AlbumMessage {
optional uint32 expectedImageCount = 2;
</file context>
Add support for hidden-voter-names polls
This PR adds support for WhatsApp's hidden-voter-names poll feature via
pollCreationMessageV6message type andhideVoterNamesboolean field.Changes
Live Proof ✓
Feature tested and verified on official WhatsApp:
Implementation Reference
Testing
After merge, polls can be created with:
Summary by cubic
Adds support for WhatsApp hidden-voter-name polls via
pollCreationMessageV6and thehideVoterNamesflag. Lets you create polls that hide voter identities while keeping vote counts.New Features
pollCreationMessageV6(Message field 119) for hidden-voter polls.hideVoterNames(PollCreationMessage field 10) with full proto encode/decode and TypeScript types.Migration
pollCreationMessageV6when creating polls that should hide voter names.hideVoterNames: truein thePollCreationMessagepayload. Existing poll flows are unchanged.Written for commit 0c39d80. Summary will update on new commits.