mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 23:53:58 +02:00
Slightly optimized box of messages reporting in HistoryWidget.
This commit is contained in:
parent
e37866d0b9
commit
eef1da56c8
1 changed files with 10 additions and 12 deletions
|
@ -3877,19 +3877,17 @@ void HistoryWidget::reportSelectedMessages() {
|
||||||
const auto ids = _list->getSelectedItems();
|
const auto ids = _list->getSelectedItems();
|
||||||
const auto peer = _peer;
|
const auto peer = _peer;
|
||||||
const auto reason = _chooseForReport->reason;
|
const auto reason = _chooseForReport->reason;
|
||||||
const auto box = std::make_shared<QPointer<Ui::GenericBox>>();
|
|
||||||
const auto weak = Ui::MakeWeak(_list.data());
|
const auto weak = Ui::MakeWeak(_list.data());
|
||||||
const auto send = [=](const QString &text) {
|
controller()->window().show(Box([=](not_null<Ui::GenericBox*> box) {
|
||||||
if (weak) {
|
Ui::ReportDetailsBox(box, [=](const QString &text) {
|
||||||
clearSelected();
|
if (weak) {
|
||||||
controller()->clearChooseReportMessages();
|
clearSelected();
|
||||||
}
|
controller()->clearChooseReportMessages();
|
||||||
HistoryView::SendReport(peer, reason, text, ids);
|
}
|
||||||
if (*box) {
|
HistoryView::SendReport(peer, reason, text, ids);
|
||||||
(*box)->closeBox();
|
box->closeBox();
|
||||||
}
|
});
|
||||||
};
|
}));
|
||||||
*box = controller()->window().show(Box(Ui::ReportDetailsBox, send));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
History *HistoryWidget::history() const {
|
History *HistoryWidget::history() const {
|
||||||
|
|
Loading…
Add table
Reference in a new issue