2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Use Images::Read instead of App::readImage.

This commit is contained in:
John Preston
2021-08-11 18:40:17 +03:00
parent b150ab8ef5
commit c79cd0b692
56 changed files with 155 additions and 293 deletions

View File

@@ -331,6 +331,15 @@ std::optional<WallPaper> WallPaper::Create(
if (!document->checkWallPaperProperties()) {
return std::nullopt;
}
const auto unsupported = data.vsettings()
&& data.vsettings()->match([&](const MTPDwallPaperSettings &data) {
return data.vsecond_background_color()
|| data.vthird_background_color()
|| data.vfourth_background_color(); // #TODO themes gradients
});
if (unsupported) {
return std::nullopt;
}
auto result = WallPaper(data.vid().v);
result._accessHash = data.vaccess_hash().v;
result._ownerId = session->userId();