From a6dbcdad5477adc0c84d4d1a8caa46954379ce41 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Tue, 20 Jul 2021 18:48:53 +0300 Subject: [PATCH] Disabled auto-closing section of scheduled messages after 'Send Now'. --- .../SourceFiles/history/view/history_view_context_menu.cpp | 6 +----- .../SourceFiles/history/view/history_view_list_widget.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp index ff3c5d221..e93161351 100644 --- a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp +++ b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp @@ -420,16 +420,12 @@ bool AddSendNowMessageAction( const auto itemId = item->fullId(); menu->addAction(tr::lng_context_send_now_msg(tr::now), [=] { if (const auto item = owner->message(itemId)) { - const auto callback = [=] { - request.navigation->showBackFromStack(); - }; Window::ShowSendNowMessagesBox( request.navigation, item->history(), (asGroup ? owner->itemOrItsGroup(item) - : MessageIdsList{ 1, itemId }), - callback); + : MessageIdsList{ 1, itemId })); } }); return true; diff --git a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp index f5947c697..dc9caa93c 100644 --- a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp @@ -3004,11 +3004,16 @@ void ConfirmSendNowSelectedItems(not_null widget) { if (!history) { return; } + const auto clearSelection = [weak = Ui::MakeWeak(widget)] { + if (const auto strong = weak.data()) { + strong->cancelSelection(); + } + }; Window::ShowSendNowMessagesBox( navigation, history, widget->getSelectedIds(), - [=] { navigation->showBackFromStack(); }); + clearSelection); } QString WrapBotCommandInChat(