2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Update API scheme to layer 108.

This commit is contained in:
John Preston
2019-12-29 15:28:27 +03:00
parent 66204bae95
commit 49129c1529
3 changed files with 29 additions and 5 deletions

View File

@@ -2719,7 +2719,8 @@ void Session::webpageApplyFields(
const auto pendingTill = TimeId(0);
const auto photo = data.vphoto();
const auto document = data.vdocument();
const auto lookupThemeDocument = [&]() -> DocumentData* {
const auto lookupInAttribute = [&](
const MTPDwebPageAttributeTheme &data) -> DocumentData* {
if (const auto documents = data.vdocuments()) {
for (const auto &document : documents->v) {
const auto processed = processDocument(document);
@@ -2730,6 +2731,20 @@ void Session::webpageApplyFields(
}
return nullptr;
};
const auto lookupThemeDocument = [&]() -> DocumentData* {
if (const auto attributes = data.vattributes()) {
for (const auto &attribute : attributes->v) {
const auto result = attribute.match([&](
const MTPDwebPageAttributeTheme &data) {
return lookupInAttribute(data);
});
if (result) {
return result;
}
}
}
return nullptr;
};
webpageApplyFields(
page,
ParseWebPageType(data),