Remove MTP from requestWallPaper interface.

This commit is contained in:
John Preston 2022-08-10 15:24:42 +03:00
parent e9fd249c5a
commit ab3d3a449b
3 changed files with 6 additions and 6 deletions

View file

@ -992,7 +992,7 @@ rpl::producer<bool> ApiWrap::dialogsLoadBlockedByDate() const {
void ApiWrap::requestWallPaper(
const QString &slug,
Fn<void(const Data::WallPaper &)> done,
Fn<void(const MTP::Error &)> fail) {
Fn<void()> fail) {
if (_wallPaperSlug != slug) {
_wallPaperSlug = slug;
if (_wallPaperRequestId) {
@ -1014,13 +1014,13 @@ void ApiWrap::requestWallPaper(
done(*paper);
}
} else if (const auto fail = base::take(_wallPaperFail)) {
fail(MTP::Error::Local("BAD_DOCUMENT", "In a wallpaper."));
fail();
}
}).fail([=](const MTP::Error &error) {
_wallPaperRequestId = 0;
_wallPaperSlug = QString();
if (const auto fail = base::take(_wallPaperFail)) {
fail(error);
fail();
}
}).send();
}

View file

@ -171,7 +171,7 @@ public:
void requestWallPaper(
const QString &slug,
Fn<void(const Data::WallPaper &)> done,
Fn<void(const MTP::Error &)> fail);
Fn<void()> fail);
void requestFullPeer(not_null<PeerData*> peer);
@ -656,7 +656,7 @@ private:
mtpRequestId _wallPaperRequestId = 0;
QString _wallPaperSlug;
Fn<void(const Data::WallPaper &)> _wallPaperDone;
Fn<void(const MTP::Error &)> _wallPaperFail;
Fn<void()> _wallPaperFail;
mtpRequestId _contactSignupSilentRequestId = 0;
std::optional<bool> _contactSignupSilent;

View file

@ -552,7 +552,7 @@ bool BackgroundPreviewBox::Start(
controller->show(Box<BackgroundPreviewBox>(
controller,
result.withUrlParams(params)));
}), crl::guard(controller, [=](const MTP::Error &error) {
}), crl::guard(controller, [=] {
controller->show(Ui::MakeInformBox(tr::lng_background_bad_link()));
}));
return true;