Fix applying poll updates.

This commit is contained in:
John Preston 2020-04-17 14:58:23 +04:00
parent 17de6c1ff3
commit c70a1f03de
1 changed files with 13 additions and 13 deletions

View File

@ -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;
});
}