Skip to content

feat: add support for hidden-voter-names polls (pollCreationMessageV6) - #2725

Open
zeative wants to merge 1 commit into
WhiskeySockets:masterfrom
zeative:add/hidden-voter-names-polls
Open

feat: add support for hidden-voter-names polls (pollCreationMessageV6)#2725
zeative wants to merge 1 commit into
WhiskeySockets:masterfrom
zeative:add/hidden-voter-names-polls

Conversation

@zeative

@zeative zeative commented Jul 24, 2026

Copy link
Copy Markdown

Add support for hidden-voter-names polls

This PR adds support for WhatsApp's hidden-voter-names poll feature via pollCreationMessageV6 message type and hideVoterNames boolean field.

Changes

  • WAProto/WAProto.proto: Add V6 message type + hideVoterNames field
  • WAProto/index.d.ts: TypeScript definitions
  • WAProto/index.js: Proto JavaScript encoding/decoding

Live Proof ✓

Feature tested and verified on official WhatsApp:

  • Normal poll: Shows vote counts
  • Hidden poll: Shows 'Names hidden' badge

Implementation Reference

Testing

After merge, polls can be created with:

pollCreationMessage: {
  name: 'Question',
  options: [{optionName: 'A'}, {optionName: 'B'}],
  hideVoterNames: true  // <-- New field
}
image

Summary by cubic

Adds support for WhatsApp hidden-voter-name polls via pollCreationMessageV6 and the hideVoterNames flag. Lets you create polls that hide voter identities while keeping vote counts.

  • New Features

    • Add pollCreationMessageV6 (Message field 119) for hidden-voter polls.
    • Add hideVoterNames (PollCreationMessage field 10) with full proto encode/decode and TypeScript types.
  • Migration

    • Use pollCreationMessageV6 when creating polls that should hide voter names.
    • Set hideVoterNames: true in the PollCreationMessage payload. Existing poll flows are unchanged.

Written for commit 0c39d80. Summary will update on new commits.

Review in cubic

- 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
@whiskeysockets-bot

Copy link
Copy Markdown
Contributor

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 works

If you’ve tested this PR, please comment below with:

Tested and working ✅

This helps us speed up the review and merge process.

📦 To test this PR locally:

# NPM
npm install @whiskeysockets/baileys@zeative/Baileys#add/hidden-voter-names-polls

# Yarn (v2+)
yarn add @whiskeysockets/baileys@zeative/Baileys#add/hidden-voter-names-polls

# PNPM
pnpm add @whiskeysockets/baileys@zeative/Baileys#add/hidden-voter-names-polls

If you encounter any issues or have feedback, feel free to comment as well.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The poll protobuf schema now supports pollCreationMessageV6 and hideVoterNames. Generated TypeScript declarations and JavaScript runtime handling cover presence tracking, serialization, deserialization, object conversion, and output mapping.

Changes

Poll hidden-voter fields

Layer / File(s) Summary
Poll schema and typings
WAProto/WAProto.proto, WAProto/index.d.ts
Adds the pollCreationMessageV6 message field and nullable hideVoterNames declarations.
Message runtime wiring
WAProto/index.js
Adds runtime initialization, presence accessors, encoding, decoding, object conversion, and output mapping for pollCreationMessageV6.
Poll creation runtime wiring
WAProto/index.js
Adds equivalent runtime handling for the optional hideVoterNames boolean.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Poem

A rabbit spots a poll in the proto bright,
With hidden names tucked out of sight.
V6 hops in, fields serialize true,
Types and runtime know what to do.
“No voter names!” the bunny cheers,
And wiggles both its floppy ears.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding support for hidden-voter-names polls via pollCreationMessageV6.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread WAProto/WAProto.proto
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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Comment thread WAProto/WAProto.proto
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Comment thread WAProto/WAProto.proto
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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Comment thread WAProto/WAProto.proto
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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants