mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-13 04:37:11 +02:00
chore: hide annoying gift button
This commit is contained in:
parent
451940e6a7
commit
ee0238bad8
2 changed files with 8 additions and 2 deletions
|
@ -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<HistoryItem*> item) {
|
||||
|
|
|
@ -781,6 +781,7 @@ private:
|
|||
object_ptr<Ui::FlatButton> _muteUnmute;
|
||||
QPointer<Ui::IconButton> _giftToChannelIn;
|
||||
QPointer<Ui::IconButton> _giftToChannelOut;
|
||||
QPointer<Ui::IconButton> _giftToChannelDiscuss;
|
||||
object_ptr<Ui::FlatButton> _discuss;
|
||||
object_ptr<Ui::FlatButton> _reportMessages;
|
||||
struct {
|
||||
|
|
Loading…
Add table
Reference in a new issue