From 776c099a257a7a9ff14903106529d63adf20cc6b Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Thu, 4 Feb 2021 20:41:03 +0300 Subject: [PATCH] Limited maximum number of selected messages for rescheduling to 20. --- .../SourceFiles/history/view/history_view_context_menu.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp index 20f399061..73ca05504 100644 --- a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp +++ b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp @@ -57,6 +57,7 @@ namespace { // If we can't cloud-export link for such time we export it locally. constexpr auto kExportLocalTimeout = crl::time(1000); +constexpr auto kRescheduleLimit = 20; //void AddToggleGroupingAction( // #feed // not_null menu, @@ -458,6 +459,9 @@ bool AddRescheduleAction( if (!request.overSelection || request.selectedItems.empty()) { return false; } + if (request.selectedItems.size() > kRescheduleLimit) { + return false; + } return true; }(); if (!goodSingle && !goodMany) { @@ -492,7 +496,7 @@ bool AddRescheduleAction( options.removeWebPageId = true; } Api::RescheduleMessage(item, options); - // Increase the scheduled date by 1ms to keep the order. + // Increase the scheduled date by 1s to keep the order. options.scheduled += 1; } };