mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Provided parent to report toasts.
This commit is contained in:
@@ -38,6 +38,7 @@ MTPreportReason ReasonToTL(const Ui::ReportReason &reason) {
|
||||
} // namespace
|
||||
|
||||
void SendReport(
|
||||
not_null<QWidget*> toastParent,
|
||||
not_null<PeerData*> peer,
|
||||
Ui::ReportReason reason,
|
||||
const QString &comment,
|
||||
@@ -48,7 +49,7 @@ void SendReport(
|
||||
ReasonToTL(reason),
|
||||
MTP_string(comment)
|
||||
)).done([=] {
|
||||
Ui::Toast::Show(tr::lng_report_thanks(tr::now));
|
||||
Ui::Toast::Show(toastParent, tr::lng_report_thanks(tr::now));
|
||||
}).send();
|
||||
} else {
|
||||
auto apiIds = QVector<MTPint>();
|
||||
@@ -62,7 +63,7 @@ void SendReport(
|
||||
ReasonToTL(reason),
|
||||
MTP_string(comment)
|
||||
)).done([=] {
|
||||
Ui::Toast::Show(tr::lng_report_thanks(tr::now));
|
||||
Ui::Toast::Show(toastParent, tr::lng_report_thanks(tr::now));
|
||||
}).send();
|
||||
}
|
||||
}
|
||||
|
@@ -16,6 +16,7 @@ enum class ReportReason;
|
||||
namespace Api {
|
||||
|
||||
void SendReport(
|
||||
not_null<QWidget*> toastParent,
|
||||
not_null<PeerData*> peer,
|
||||
Ui::ReportReason reason,
|
||||
const QString &comment,
|
||||
|
Reference in New Issue
Block a user