From 928d8feb21f38231dc052bc29717e1e9f42a88f2 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 11 Jan 2022 19:19:30 +0300 Subject: [PATCH] Improve clearing of reaction animations. --- .../history/view/history_view_bottom_info.cpp | 11 +++++++++-- .../history/view/history_view_reactions.cpp | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp b/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp index dc73121a8..94b14444c 100644 --- a/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp +++ b/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp @@ -239,10 +239,12 @@ void BottomInfo::paintReactions( auto x = left; auto y = top; auto widthLeft = availableWidth; - const auto animated = (_reactionAnimation && context.reactionEffects) + const auto animated = _reactionAnimation ? _reactionAnimation->playingAroundEmoji() : QString(); - if (_reactionAnimation && animated.isEmpty()) { + if (_reactionAnimation + && context.reactionEffects + && animated.isEmpty()) { _reactionAnimation = nullptr; } for (const auto &reaction : _reactions) { @@ -361,6 +363,11 @@ void BottomInfo::layoutRepliesText() { } void BottomInfo::layoutReactionsText() { + if (_reactionAnimation + && !_data.reactions.contains( + _reactionAnimation->playingAroundEmoji())) { + _reactionAnimation = nullptr; + } if (_data.reactions.empty()) { _reactions.clear(); return; diff --git a/Telegram/SourceFiles/history/view/history_view_reactions.cpp b/Telegram/SourceFiles/history/view/history_view_reactions.cpp index c770a5d7b..f1153b587 100644 --- a/Telegram/SourceFiles/history/view/history_view_reactions.cpp +++ b/Telegram/SourceFiles/history/view/history_view_reactions.cpp @@ -193,7 +193,7 @@ void InlineList::paint( const auto animated = (_animation && context.reactionEffects) ? _animation->playingAroundEmoji() : QString(); - if (_animation && animated.isEmpty()) { + if (_animation && context.reactionEffects && animated.isEmpty()) { _animation = nullptr; } p.setFont(st::semiboldFont);