From a97d5e80c7968f469a7b61e91fd04db8b8490777 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 5 Sep 2024 19:13:52 +0400 Subject: [PATCH] Fix custom reaction as a quick one. --- Telegram/SourceFiles/data/data_message_reactions.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Telegram/SourceFiles/data/data_message_reactions.cpp b/Telegram/SourceFiles/data/data_message_reactions.cpp index 6ba0b88b1..ac5791ef8 100644 --- a/Telegram/SourceFiles/data/data_message_reactions.cpp +++ b/Telegram/SourceFiles/data/data_message_reactions.cpp @@ -261,6 +261,15 @@ PossibleItemReactionsRef LookupPossibleReactions( } result.customAllowed = (allowed.type == AllowedReactionsType::All) && premiumPossible; + + const auto favoriteId = reactions->favoriteId(); + if (favoriteId.custom() + && result.customAllowed + && !ranges::contains(result.recent, favoriteId, &Reaction::id)) { + if (const auto temp = reactions->lookupTemporary(favoriteId)) { + result.recent.insert(begin(result.recent), temp); + } + } } if (!item->reactionsAreTags()) { const auto toFront = [&](Data::ReactionId id) {