From 4996d90782c77a3b64d2c9000daff090a6c34f3f Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 17 Jan 2022 21:29:28 +0300 Subject: [PATCH] Fix first my reaction userpic in groups. --- Telegram/SourceFiles/history/history_item.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index 8098f9b5e..e04fa612f 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -794,11 +794,17 @@ void HistoryItem::addReaction(const QString &reaction) { void HistoryItem::toggleReaction(const QString &reaction) { if (!_reactions) { _reactions = std::make_unique(this); + const auto canViewReactions = !isDiscussionPost() + && (history()->peer->isChat() || history()->peer->isMegagroup()); + if (canViewReactions) { + _flags |= MessageFlag::CanViewReactions; + } _reactions->add(reaction); } else if (_reactions->chosen() == reaction) { _reactions->remove(); if (_reactions->empty()) { _reactions = nullptr; + _flags &= ~MessageFlag::CanViewReactions; history()->owner().notifyItemDataChange(this); } } else {