mirror of https://github.com/procxx/kepka.git
Fix collage/slideshow extracting in GCC.
It was depending on argument evaluation order before that fix.
This commit is contained in:
parent
4e6f55e176
commit
3b911f19f6
|
@ -89,6 +89,14 @@ WebPageCollage ExtractCollage(const MTPDwebPage &data) {
|
||||||
if (!data.has_cached_page()) {
|
if (!data.has_cached_page()) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
const auto parseMedia = [&] {
|
||||||
|
if (data.has_photo()) {
|
||||||
|
Auth().data().photo(data.vphoto);
|
||||||
|
}
|
||||||
|
if (data.has_document()) {
|
||||||
|
Auth().data().document(data.vdocument);
|
||||||
|
}
|
||||||
|
};
|
||||||
return data.vcached_page.match([&](const auto &page) {
|
return data.vcached_page.match([&](const auto &page) {
|
||||||
for (const auto &block : page.vblocks.v) {
|
for (const auto &block : page.vblocks.v) {
|
||||||
switch (block.type()) {
|
switch (block.type()) {
|
||||||
|
@ -100,11 +108,13 @@ WebPageCollage ExtractCollage(const MTPDwebPage &data) {
|
||||||
case mtpc_pageBlockAudio:
|
case mtpc_pageBlockAudio:
|
||||||
return WebPageCollage();
|
return WebPageCollage();
|
||||||
case mtpc_pageBlockSlideshow:
|
case mtpc_pageBlockSlideshow:
|
||||||
|
parseMedia();
|
||||||
return ExtractCollage(
|
return ExtractCollage(
|
||||||
block.c_pageBlockSlideshow().vitems.v,
|
block.c_pageBlockSlideshow().vitems.v,
|
||||||
page.vphotos.v,
|
page.vphotos.v,
|
||||||
page.vdocuments.v);
|
page.vdocuments.v);
|
||||||
case mtpc_pageBlockCollage:
|
case mtpc_pageBlockCollage:
|
||||||
|
parseMedia();
|
||||||
return ExtractCollage(
|
return ExtractCollage(
|
||||||
block.c_pageBlockCollage().vitems.v,
|
block.c_pageBlockCollage().vitems.v,
|
||||||
page.vphotos.v,
|
page.vphotos.v,
|
||||||
|
|
Loading…
Reference in New Issue