Fixed ability to mark as read all chats for wrong account.

This commit is contained in:
23rd 2024-12-20 19:05:49 +03:00
parent aa1f8cfb8f
commit 80a1e6ecf3
3 changed files with 8 additions and 5 deletions

View file

@ -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;

View file

@ -2767,10 +2767,11 @@ void UnpinAllMessages(
}
void MenuAddMarkAsReadAllChatsAction(
not_null<Window::SessionController*> controller,
not_null<Main::Session*> session,
std::shared_ptr<Ui::Show> 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<void()> &&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)

View file

@ -74,7 +74,8 @@ void FillSenderUserpicMenu(
const PeerMenuCallback &addAction);
void MenuAddMarkAsReadAllChatsAction(
not_null<Window::SessionController*> controller,
not_null<Main::Session*> session,
std::shared_ptr<Ui::Show> show,
const PeerMenuCallback &addAction);
void MenuAddMarkAsReadChatListAction(