From 075ab20e5b15b46a03d05cf27eea9749f69ee1ea Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 26 Apr 2022 14:13:11 +0400 Subject: [PATCH] Version 3.7.3: Don't copy text from a restricted post. --- .../history/view/history_view_list_widget.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp index ddbb5e941..21e3d7aa2 100644 --- a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp @@ -1243,6 +1243,11 @@ bool ListWidget::hasCopyRestrictionForSelected() const { if (hasCopyRestriction()) { return true; } + if (_selected.empty()) { + if (_selectedTextItem && _selectedTextItem->forbidsForward()) { + return true; + } + } for (const auto &[itemId, selection] : _selected) { if (const auto item = session().data().message(itemId)) { if (item->forbidsForward()) { @@ -1254,6 +1259,11 @@ bool ListWidget::hasCopyRestrictionForSelected() const { } bool ListWidget::showCopyRestrictionForSelected() { + if (_selected.empty()) { + if (_selectedTextItem && showCopyRestriction(_selectedTextItem)) { + return true; + } + } for (const auto &[itemId, selection] : _selected) { if (showCopyRestriction(session().data().message(itemId))) { return true;