diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 279ab2d84..b8cf9e6d5 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -24518,14 +24518,19 @@ Result> MessagesManager::get_mess vector> popular_reaction_objects; vector> last_reaction_objects; + FlatHashSet added_custom_reactions; auto add_reactions = [&](vector> &reaction_objects, const vector &reactions) { for (auto &reaction : reactions) { if (all_available_reactions.erase(reaction) != 0) { // add available reaction + if (is_custom_reaction(reaction)) { + added_custom_reactions.insert(reaction); + } reaction_objects.push_back( td_api::make_object(get_reaction_type_object(reaction), false)); - } else if (is_custom_reaction(reaction) && available_reactions.allow_custom_) { + } else if (is_custom_reaction(reaction) && available_reactions.allow_custom_ && + added_custom_reactions.insert(reaction).second) { // add implicitly available custom reaction reaction_objects.push_back( td_api::make_object(get_reaction_type_object(reaction), !is_premium));