diff --git a/Telegram/SourceFiles/settings/settings_information.cpp b/Telegram/SourceFiles/settings/settings_information.cpp index 97fe68bd9..cde71d622 100644 --- a/Telegram/SourceFiles/settings/settings_information.cpp +++ b/Telegram/SourceFiles/settings/settings_information.cpp @@ -751,7 +751,8 @@ void SetupAccountsWrap( raw, st::popupMenuWithIcons); Window::MenuAddMarkAsReadAllChatsAction( - window, + session, + window->uiShow(), Ui::Menu::CreateAddActionCallback(state->menu)); state->menu->popup(QCursor::pos()); return; diff --git a/Telegram/SourceFiles/window/window_peer_menu.cpp b/Telegram/SourceFiles/window/window_peer_menu.cpp index 9ec50c3a0..108579e46 100644 --- a/Telegram/SourceFiles/window/window_peer_menu.cpp +++ b/Telegram/SourceFiles/window/window_peer_menu.cpp @@ -2767,10 +2767,11 @@ void UnpinAllMessages( } void MenuAddMarkAsReadAllChatsAction( - not_null controller, + not_null session, + std::shared_ptr show, const PeerMenuCallback &addAction) { // There is no async to make weak from controller. - auto callback = [=, owner = &controller->session().data()] { + auto callback = [=, owner = &session->data()] { auto boxCallback = [=](Fn &&close) { close(); @@ -2779,7 +2780,7 @@ void MenuAddMarkAsReadAllChatsAction( MarkAsReadChatList(folder->chatsList()); } }; - controller->show( + show->show( Ui::MakeConfirmBox({ tr::lng_context_mark_read_all_sure(), std::move(boxCallback) diff --git a/Telegram/SourceFiles/window/window_peer_menu.h b/Telegram/SourceFiles/window/window_peer_menu.h index 6ef96c9f5..7e2314f59 100644 --- a/Telegram/SourceFiles/window/window_peer_menu.h +++ b/Telegram/SourceFiles/window/window_peer_menu.h @@ -74,7 +74,8 @@ void FillSenderUserpicMenu( const PeerMenuCallback &addAction); void MenuAddMarkAsReadAllChatsAction( - not_null controller, + not_null session, + std::shared_ptr show, const PeerMenuCallback &addAction); void MenuAddMarkAsReadChatListAction(