diff --git a/Telegram/SourceFiles/data/data_channel.cpp b/Telegram/SourceFiles/data/data_channel.cpp index 42c335fe1..7c2846d5d 100644 --- a/Telegram/SourceFiles/data/data_channel.cpp +++ b/Telegram/SourceFiles/data/data_channel.cpp @@ -966,7 +966,8 @@ void ChannelData::setAllowedReactions(Data::AllowedReactions value) { if (_allowedReactions != value) { const auto enabled = [](const Data::AllowedReactions &allowed) { return (allowed.type != Data::AllowedReactionsType::Some) - || !allowed.some.empty(); + || !allowed.some.empty() + || allowed.paidEnabled; }; const auto was = enabled(_allowedReactions); _allowedReactions = std::move(value); diff --git a/Telegram/SourceFiles/data/data_chat.cpp b/Telegram/SourceFiles/data/data_chat.cpp index b5f5bcf66..6f285e805 100644 --- a/Telegram/SourceFiles/data/data_chat.cpp +++ b/Telegram/SourceFiles/data/data_chat.cpp @@ -293,7 +293,8 @@ void ChatData::setAllowedReactions(Data::AllowedReactions value) { if (_allowedReactions != value) { const auto enabled = [](const Data::AllowedReactions &allowed) { return (allowed.type != Data::AllowedReactionsType::Some) - || !allowed.some.empty(); + || !allowed.some.empty() + || allowed.paidEnabled; }; const auto was = enabled(_allowedReactions); _allowedReactions = std::move(value); diff --git a/Telegram/SourceFiles/data/data_message_reactions.cpp b/Telegram/SourceFiles/data/data_message_reactions.cpp index bd743376e..1457eaddc 100644 --- a/Telegram/SourceFiles/data/data_message_reactions.cpp +++ b/Telegram/SourceFiles/data/data_message_reactions.cpp @@ -177,6 +177,7 @@ PossibleItemReactionsRef LookupPossibleReactions( const auto &myTags = reactions->list(Reactions::Type::MyTags); const auto &tags = reactions->list(Reactions::Type::Tags); const auto &all = item->reactions(); + const auto &allowed = PeerAllowedReactions(peer); const auto limit = UniqueReactionsLimit(peer); const auto premiumPossible = session->premiumPossible(); const auto limited = (all.size() >= limit) && [&] { @@ -212,7 +213,10 @@ PossibleItemReactionsRef LookupPossibleReactions( result.customAllowed = premiumPossible; result.tags = true; } else if (limited) { - result.recent.reserve(all.size()); + result.recent.reserve((allowed.paidEnabled ? 1 : 0) + all.size()); + if (allowed.paidEnabled) { + result.recent.push_back(reactions->lookupPaid()); + } add([&](const Reaction &reaction) { return ranges::contains(all, reaction.id, &MessageReaction::id); }); @@ -225,7 +229,6 @@ PossibleItemReactionsRef LookupPossibleReactions( } } } else { - const auto &allowed = PeerAllowedReactions(peer); result.recent.reserve((allowed.paidEnabled ? 1 : 0) + ((allowed.type == AllowedReactionsType::Some) ? allowed.some.size() diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index f2688e517..4f0b5fa8a 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -2572,7 +2572,7 @@ void HistoryItem::toggleReaction( _reactions->add(reaction, addToRecent); } else if (ranges::contains(_reactions->chosen(), reaction)) { _reactions->remove(reaction); - if (_reactions->empty()) { + if (_reactions->empty() && !_reactions->localPaidData()) { _reactions = nullptr; _flags &= ~MessageFlag::CanViewReactions; }