Add backup support for polls

This commit is contained in:
yash-signal
2025-11-03 10:51:21 -06:00
committed by GitHub
parent 64d5eb99b7
commit 6bf79848c1
9 changed files with 497 additions and 4 deletions

View File

@@ -428,6 +428,7 @@ message ChatItem {
GiftBadge giftBadge = 17;
ViewOnceMessage viewOnceMessage = 18;
DirectStoryReplyMessage directStoryReplyMessage = 19; // group story reply messages are not backed up
Poll poll = 20;
}
}
@@ -760,6 +761,7 @@ message Quote {
NORMAL = 1;
GIFT_BADGE = 2;
VIEW_ONCE = 3;
POLL = 4;
}
message QuotedAttachment {
@@ -806,6 +808,31 @@ message Reaction {
uint64 sortOrder = 4;
}
message Poll {
message PollOption {
message PollVote {
uint64 voterId = 1; // A direct reference to Recipient proto id. Must be self or contact.
uint32 voteCount = 2; // Tracks how many times you voted.
}
string option = 1; // Between 1-100 characters
repeated PollVote votes = 2;
}
string question = 1; // Between 1-100 characters
bool allowMultiple = 2;
repeated PollOption options = 3; // At least two
bool hasEnded = 4;
repeated Reaction reactions = 5;
}
message PollTerminateUpdate {
uint64 targetSentTimestamp = 1;
string question = 2; // Between 1-100 characters
}
message ChatUpdateMessage {
// If unset, importers should ignore the update message without throwing an error.
oneof update {
@@ -818,6 +845,7 @@ message ChatUpdateMessage {
IndividualCall individualCall = 7;
GroupCall groupCall = 8;
LearnedProfileChatUpdate learnedProfileChange = 9;
PollTerminateUpdate pollTerminate = 10;
}
}