2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 22:55:11 +00:00

Detach ComposeControls from SessionController.

This commit is contained in:
John Preston
2023-05-02 13:33:19 +04:00
parent 665467b02d
commit 65afa2c402
178 changed files with 2080 additions and 1869 deletions

View File

@@ -13,7 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "lang/lang_keys.h"
#include "main/main_session.h"
#include "ui/boxes/report_box.h"
#include "ui/toast/toast.h"
#include "ui/layers/show.h"
namespace Api {
@@ -39,15 +39,14 @@ MTPreportReason ReasonToTL(const Ui::ReportReason &reason) {
} // namespace
void SendReport(
not_null<QWidget*> toastParent,
std::shared_ptr<Ui::Show> show,
not_null<PeerData*> peer,
Ui::ReportReason reason,
const QString &comment,
std::variant<v::null_t, MessageIdsList, not_null<PhotoData*>> data) {
auto weak = Ui::MakeWeak(toastParent.get());
auto done = crl::guard(toastParent, [=] {
Ui::Toast::Show(toastParent, tr::lng_report_thanks(tr::now));
});
auto done = [=] {
show->showToast(tr::lng_report_thanks(tr::now));
};
v::match(data, [&](v::null_t) {
peer->session().api().request(MTPaccount_ReportPeer(
peer->input,