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

Create ImagePtr-s using a factory method.

This commit is contained in:
John Preston
2018-10-23 13:08:50 +04:00
parent 591fbf0ec6
commit 8b76428c7e
17 changed files with 348 additions and 439 deletions

View File

@@ -79,14 +79,15 @@ std::unique_ptr<Result> Result::create(uint64 queryId, const MTPBotInlineResult
if (r.has_description()) result->_description = qs(r.vdescription);
if (r.has_url()) result->_url = qs(r.vurl);
if (r.has_thumb()) {
result->_thumb = ImagePtr(r.vthumb, result->thumbBox());
result->_thumb = Images::Create(r.vthumb, result->thumbBox());
}
if (r.has_content()) {
result->_content_url = GetContentUrl(r.vcontent);
if (result->_type == Type::Photo) {
result->_photo = Auth().data().photoFromWeb(
r.vcontent,
result->_thumb);
result->_thumb,
true);
} else {
result->_document = Auth().data().documentFromWeb(
result->adjustAttributes(r.vcontent),
@@ -237,7 +238,7 @@ std::unique_ptr<Result> Result::create(uint64 queryId, const MTPBotInlineResult
location.height = h;
location.zoom = zoom;
location.scale = scale;
result->_locationThumb = ImagePtr(location);
result->_locationThumb = Images::Create(location);
}
return result;