Don't close calls log box after delete confirmation.

This commit is contained in:
John Preston 2021-01-26 12:41:52 +04:00
parent fa8dd61b02
commit 52000566cf
2 changed files with 8 additions and 3 deletions

View File

@ -873,10 +873,13 @@ void DeleteMessagesBox::deleteAndClear() {
// deleteMessages can initiate closing of the current section,
// which will cause this box to be destroyed.
const auto session = _session;
const auto weak = Ui::MakeWeak(this);
_session->data().histories().deleteMessages(_ids, revoke);
session->data().histories().deleteMessages(_ids, revoke);
Ui::hideLayer();
if (const auto strong = weak.data()) {
strong->closeBox();
}
session->data().sendHistoryChangeNotifications();
}

View File

@ -355,7 +355,9 @@ base::unique_qptr<Ui::PopupMenu> BoxController::rowContextMenu(
auto result = base::make_unique_q<Ui::PopupMenu>(parent);
result->addAction(tr::lng_context_delete_selected(tr::now), [=] {
Ui::show(Box<DeleteMessagesBox>(session, base::duplicate(ids)));
Ui::show(
Box<DeleteMessagesBox>(session, base::duplicate(ids)),
Ui::LayerOption::KeepOther);
});
return result;
}