2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Fix channel reactions list editing.

This commit is contained in:
John Preston
2024-08-13 10:08:51 +02:00
parent 0a1ddddd81
commit 7ef44fb621
2 changed files with 58 additions and 19 deletions

View File

@@ -214,20 +214,21 @@ PossibleItemReactionsRef LookupPossibleReactions(
result.tags = true;
} else if (limited) {
result.recent.reserve((allowed.paidEnabled ? 1 : 0) + all.size());
if (allowed.paidEnabled) {
result.recent.push_back(reactions->lookupPaid());
}
add([&](const Reaction &reaction) {
return ranges::contains(all, reaction.id, &MessageReaction::id);
});
for (const auto &reaction : all) {
const auto id = reaction.id;
if (!added.contains(id)) {
if (added.emplace(id).second) {
if (const auto temp = reactions->lookupTemporary(id)) {
result.recent.push_back(temp);
}
}
}
if (allowed.paidEnabled
&& !added.contains(Data::ReactionId::Paid())) {
result.recent.push_back(reactions->lookupPaid());
}
} else {
result.recent.reserve((allowed.paidEnabled ? 1 : 0)
+ ((allowed.type == AllowedReactionsType::Some)