From ee0238bad8f3e8e4abfd9572744a6851fa417be7 Mon Sep 17 00:00:00 2001 From: AlexeyZavar Date: Fri, 14 Feb 2025 02:07:32 +0300 Subject: [PATCH] chore: hide annoying gift button --- Telegram/SourceFiles/history/history_widget.cpp | 9 +++++++-- Telegram/SourceFiles/history/history_widget.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index f61c61bde..4aa1f69b2 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -1090,15 +1090,19 @@ void HistoryWidget::refreshJoinChannelText() { } void HistoryWidget::refreshGiftToChannelShown() { - if (!_giftToChannelIn || !_giftToChannelOut) { + if (!_giftToChannelIn || !_giftToChannelOut || !_giftToChannelDiscuss) { return; } + // AyuGram: hide gift button almost everywhere + // still accessible via the menu in peer window const auto channel = _peer->asChannel(); const auto shown = channel && channel->isBroadcast() - && channel->stargiftsAvailable(); + && channel->stargiftsAvailable() + && isExteraPeer(getBareID(channel)); _giftToChannelIn->setVisible(shown); _giftToChannelOut->setVisible(shown); + _giftToChannelDiscuss->setVisible(shown); } void HistoryWidget::refreshTopBarActiveChat() { @@ -2144,6 +2148,7 @@ void HistoryWidget::setupGiftToChannelButton() { }; _giftToChannelIn = setupButton(_muteUnmute); _giftToChannelOut = setupButton(_joinChannel); + _giftToChannelDiscuss = setupButton(_discuss); } void HistoryWidget::pushReplyReturn(not_null item) { diff --git a/Telegram/SourceFiles/history/history_widget.h b/Telegram/SourceFiles/history/history_widget.h index 7c062f7da..9321f19c4 100644 --- a/Telegram/SourceFiles/history/history_widget.h +++ b/Telegram/SourceFiles/history/history_widget.h @@ -781,6 +781,7 @@ private: object_ptr _muteUnmute; QPointer _giftToChannelIn; QPointer _giftToChannelOut; + QPointer _giftToChannelDiscuss; object_ptr _discuss; object_ptr _reportMessages; struct {