mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-05 09:05:14 +00:00
Simplest polls data export.
This commit is contained in:
@@ -436,6 +436,19 @@ QByteArray SerializeMessage(
|
||||
? "ID-" + NumberToString(data.receiptMsgId)
|
||||
: QByteArray()) }
|
||||
}));
|
||||
}, [&](const Poll &data) {
|
||||
push("Poll", SerializeKeyValue({
|
||||
{ "Question", data.question },
|
||||
{ "Closed", data.closed ? QByteArray("Yes") : QByteArray() },
|
||||
{ "Votes", NumberToString(data.totalVotes) },
|
||||
}));
|
||||
for (const auto &answer : data.answers) {
|
||||
push("Answer", SerializeKeyValue({
|
||||
{ "Text", answer.text },
|
||||
{ "Votes", NumberToString(answer.votes) },
|
||||
{ "Chosen", answer.my ? QByteArray("Yes") : QByteArray() }
|
||||
}));
|
||||
}
|
||||
}, [](const UnsupportedMedia &data) {
|
||||
Unexpected("Unsupported message.");
|
||||
}, [](std::nullopt_t) {});
|
||||
|
Reference in New Issue
Block a user