From ded570a480f09a6c4cc8eb0ee9aa5243bba4ce63 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 25 Sep 2023 06:26:40 +0300 Subject: [PATCH] Fixed display of bulk download menu item on restricted content. --- Telegram/SourceFiles/history/history_inner_widget.cpp | 4 ++-- .../SourceFiles/history/view/history_view_context_menu.cpp | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index 0d0489dd8..b961b1e90 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -2374,7 +2374,7 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { _widget->confirmDeleteSelected(); }, &st::menuIconDelete); } - if (selectedState.count > 0) { + if (selectedState.count > 0 && !hasCopyRestrictionForSelected()) { Menu::AddDownloadFilesAction(_menu, controller, _selected, this); } _menu->addAction(tr::lng_context_clear_selection(tr::now), [=] { @@ -2572,7 +2572,7 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { _widget->confirmDeleteSelected(); }, &st::menuIconDelete); } - if (selectedState.count > 0) { + if (selectedState.count > 0 && !hasCopyRestrictionForSelected()) { Menu::AddDownloadFilesAction(_menu, controller, _selected, this); } _menu->addAction(tr::lng_context_clear_selection(tr::now), [=] { diff --git a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp index 409ae264d..7bc9c5b57 100644 --- a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp +++ b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp @@ -830,7 +830,9 @@ void AddDownloadFilesAction( not_null menu, const ContextMenuRequest &request, not_null list) { - if (!request.overSelection || request.selectedItems.empty()) { + if (!request.overSelection + || request.selectedItems.empty() + || list->hasCopyRestrictionForSelected()) { return; } Menu::AddDownloadFilesAction(