diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 0ce1ab5fad..844e346755 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -3877,19 +3877,17 @@ void HistoryWidget::reportSelectedMessages() { const auto ids = _list->getSelectedItems(); const auto peer = _peer; const auto reason = _chooseForReport->reason; - const auto box = std::make_shared>(); const auto weak = Ui::MakeWeak(_list.data()); - const auto send = [=](const QString &text) { - if (weak) { - clearSelected(); - controller()->clearChooseReportMessages(); - } - HistoryView::SendReport(peer, reason, text, ids); - if (*box) { - (*box)->closeBox(); - } - }; - *box = controller()->window().show(Box(Ui::ReportDetailsBox, send)); + controller()->window().show(Box([=](not_null box) { + Ui::ReportDetailsBox(box, [=](const QString &text) { + if (weak) { + clearSelected(); + controller()->clearChooseReportMessages(); + } + HistoryView::SendReport(peer, reason, text, ids); + box->closeBox(); + }); + })); } History *HistoryWidget::history() const {