From aab4dbb7cf3ec4bc3a092e971c9a0ec343027fbc Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 16 Nov 2021 12:10:59 +0400 Subject: [PATCH] Hide export and fast share for noforwards. --- Telegram/SourceFiles/data/data_peer.cpp | 2 +- Telegram/SourceFiles/history/view/history_view_message.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/data/data_peer.cpp b/Telegram/SourceFiles/data/data_peer.cpp index 19ea59404..29d5f01b2 100644 --- a/Telegram/SourceFiles/data/data_peer.cpp +++ b/Telegram/SourceFiles/data/data_peer.cpp @@ -518,7 +518,7 @@ bool PeerData::canEditMessagesIndefinitely() const { } bool PeerData::canExportChatHistory() const { - if (isRepliesChat()) { + if (isRepliesChat() || !allowsForwarding()) { return false; } if (const auto channel = asChannel()) { diff --git a/Telegram/SourceFiles/history/view/history_view_message.cpp b/Telegram/SourceFiles/history/view/history_view_message.cpp index d6ebd1d6c..2840cd385 100644 --- a/Telegram/SourceFiles/history/view/history_view_message.cpp +++ b/Telegram/SourceFiles/history/view/history_view_message.cpp @@ -2217,7 +2217,7 @@ std::optional Message::rightActionSize() const { bool Message::displayFastShare() const { const auto item = message(); const auto peer = item->history()->peer; - if (!item->isRegular()) { + if (!item->isRegular() || !peer->allowsForwarding()) { return false; } else if (peer->isChannel()) { return !peer->isMegagroup();