2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Save wallpaper settings locally.

This commit is contained in:
John Preston
2019-01-28 16:59:49 +03:00
parent 2f702148e3
commit f506a5ea6c
14 changed files with 624 additions and 266 deletions

View File

@@ -884,24 +884,13 @@ void ApiWrap::requestWallPaper(
)).done([=](const MTPWallPaper &result) {
_wallPaperRequestId = 0;
_wallPaperSlug = QString();
result.match([&](const MTPDwallPaper &data) {
const auto document = _session->data().processDocument(
data.vdocument);
if (document->checkWallPaperProperties()) {
if (const auto done = base::take(_wallPaperDone)) {
done({
data.vid.v,
data.vaccess_hash.v,
data.vflags.v,
qs(data.vslug),
document->thumbnail(),
document
});
}
} else if (const auto fail = base::take(_wallPaperFail)) {
fail(RPCError::Local("BAD_DOCUMENT", "In a wallpaper."));
if (const auto paper = Data::WallPaper::Create(result)) {
if (const auto done = base::take(_wallPaperDone)) {
done(*paper);
}
});
} else if (const auto fail = base::take(_wallPaperFail)) {
fail(RPCError::Local("BAD_DOCUMENT", "In a wallpaper."));
}
}).fail([=](const RPCError &error) {
_wallPaperRequestId = 0;
_wallPaperSlug = QString();