mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-01 15:15:13 +00:00
Fix possible assertion violation in non-self reaction.
This commit is contained in:
@@ -966,13 +966,16 @@ void MessageReactions::add(const ReactionId &id, bool addToRecent) {
|
|||||||
const auto removed = !--one.count;
|
const auto removed = !--one.count;
|
||||||
const auto j = _recent.find(one.id);
|
const auto j = _recent.find(one.id);
|
||||||
if (j != end(_recent)) {
|
if (j != end(_recent)) {
|
||||||
j->second.erase(
|
if (removed) {
|
||||||
ranges::remove(j->second, self, &RecentReaction::peer),
|
j->second.clear();
|
||||||
end(j->second));
|
|
||||||
if (j->second.empty()) {
|
|
||||||
_recent.erase(j);
|
_recent.erase(j);
|
||||||
} else {
|
} else {
|
||||||
Assert(!removed);
|
j->second.erase(
|
||||||
|
ranges::remove(j->second, self, &RecentReaction::peer),
|
||||||
|
end(j->second));
|
||||||
|
if (j->second.empty()) {
|
||||||
|
_recent.erase(j);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return removed;
|
return removed;
|
||||||
|
Reference in New Issue
Block a user