From 8628e79245b0cf05b2c85230910a30670c6dcb32 Mon Sep 17 00:00:00 2001 From: Ireina <140869597+re-zero001@users.noreply.github.com> Date: Mon, 30 Mar 2026 15:10:44 +0800 Subject: [PATCH] fix: hide single filtered reactions --- .../view/reactions/history_view_reactions.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Telegram/SourceFiles/history/view/reactions/history_view_reactions.cpp b/Telegram/SourceFiles/history/view/reactions/history_view_reactions.cpp index 42ea94a6a0..f47bd60464 100644 --- a/Telegram/SourceFiles/history/view/reactions/history_view_reactions.cpp +++ b/Telegram/SourceFiles/history/view/reactions/history_view_reactions.cpp @@ -938,6 +938,22 @@ InlineListData InlineListDataFromMessage(not_null view) { return FiltersController::isBlocked(peer); }), end(peers)); } + for (auto i = result.reactions.begin(); i != result.reactions.end();) { + const auto j = result.recent.find(i->id); + if (j == end(result.recent)) { + ++i; + continue; + } + if (const auto hidden = i->count - int(j->second.size()); hidden > 0) { + i->count -= hidden; + } + if (i->count > 0) { + ++i; + } else { + result.recent.erase(j); + i = result.reactions.erase(i); + } + } } result.flags = (view->hasOutLayout() ? Flag::OutLayout : Flag()) | (view->embedReactionsInBubble() ? Flag::InBubble : Flag())