mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Fix applying poll updates.
This commit is contained in:
@@ -147,6 +147,7 @@ bool PollData::applyResults(const MTPPollResults &results) {
|
||||
}) | ranges::to_vector;
|
||||
}
|
||||
}
|
||||
if (results.vsolution()) {
|
||||
auto newSolution = TextWithEntities{
|
||||
results.vsolution().value_or_empty(),
|
||||
Api::EntitiesFromMTP(
|
||||
@@ -156,6 +157,7 @@ bool PollData::applyResults(const MTPPollResults &results) {
|
||||
solution = std::move(newSolution);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
if (!changed) {
|
||||
return false;
|
||||
}
|
||||
@@ -205,12 +207,10 @@ bool PollData::applyResultToAnswers(
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
if (!isMinResults || closed()) {
|
||||
if (answer->correct != voters.is_correct()) {
|
||||
if (voters.is_correct() && !answer->correct) {
|
||||
answer->correct = voters.is_correct();
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
return changed;
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user