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