mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-05 00:46:08 +00:00
Always display nice percent values.
Sum of percent values should never exceed 100%. If any two answers received same amount of votes, they should show same percent values. This way sum could be less than 100% (three answers, one vote each), but this looks better than giving extra vote to some random answer.
This commit is contained in:
@@ -1523,7 +1523,7 @@ not_null<PollData*> Session::poll(const MTPDmessageMediaPoll &data) {
|
||||
const auto result = poll(data.vpoll);
|
||||
const auto changed = result->applyResults(data.vresults);
|
||||
if (changed) {
|
||||
requestPollViewRepaint(result);
|
||||
notifyPollUpdateDelayed(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -1538,7 +1538,7 @@ void Session::applyPollUpdate(const MTPDupdateMessagePoll &update) {
|
||||
: i->second.get();
|
||||
}();
|
||||
if (updated && updated->applyResults(update.vresults)) {
|
||||
requestPollViewRepaint(updated);
|
||||
notifyPollUpdateDelayed(updated);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user