Commit 4878129
fix(send-poll): preserve whatsmeow's 0=unlimited semantics
Reverts the over-restrictive validation introduced in 9b8e7f0:
whatsmeow's BuildPollCreation treats selectableOptionCount=0 as
"multi-select with no limit" (msgsecret.go:300-308) and silently
coerces out-of-range values to 0. Forcing a minimum of 1 and
defaulting omitted requests to 1 silently removed access to the
unlimited-select mode and rewrote caller intent.
- Allow 0 (unlimited) again in both Python and Go validation; reject
only negative or > len(options).
- Drop the *int pointer indirection on SendPollRequest — int's
zero-value already maps cleanly to whatsmeow's "unlimited" sentinel.
- Document the three-way semantics on the request type and update
error messages.
- Replace the zero-rejection test with one asserting 0 is accepted
and forwarded as-is, plus a negative-value rejection test.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 305f964 commit 4878129
2 files changed
Lines changed: 28 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
819 | 819 | | |
820 | 820 | | |
821 | 821 | | |
822 | | - | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
823 | 828 | | |
824 | | - | |
825 | | - | |
826 | | - | |
827 | | - | |
828 | | - | |
829 | | - | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
830 | 833 | | |
831 | 834 | | |
832 | 835 | | |
| |||
1518 | 1521 | | |
1519 | 1522 | | |
1520 | 1523 | | |
1521 | | - | |
1522 | | - | |
1523 | | - | |
1524 | | - | |
1525 | | - | |
1526 | | - | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
1527 | 1528 | | |
1528 | 1529 | | |
1529 | 1530 | | |
1530 | | - | |
| 1531 | + | |
1531 | 1532 | | |
1532 | 1533 | | |
1533 | 1534 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
| 39 | + | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
44 | 55 | | |
45 | 56 | | |
46 | 57 | | |
| |||
0 commit comments