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

HistoryMedia always holds a pointer to its parent HistoryItem.

Using local cached data when sending media inline bot results.
This commit is contained in:
John Preston
2016-04-10 18:53:01 +04:00
parent 1fe562ec13
commit fe59c815b2
13 changed files with 673 additions and 576 deletions

View File

@@ -310,12 +310,14 @@ void Result::createPhoto() {
if (_photo) return;
if (_thumb_url.isEmpty()) {
QSize thumb = shrinkToKeepAspect(_width, _height, 100, 100);
_thumb = ImagePtr(thumb.width(), thumb.height());
QSize thumbsize = shrinkToKeepAspect(_width, _height, 100, 100);
_thumb = ImagePtr(thumbsize.width(), thumbsize.height());
} else {
_thumb = ImagePtr(_thumb_url, QSize(100, 100));
_thumb = ImagePtr(_thumb_url, QSize(320, 320));
}
ImagePtr medium = ImagePtr(_content_url, QSize(320, 320));
// ImagePtr medium = ImagePtr(_content_url, QSize(320, 320));
QSize mediumsize = shrinkToKeepAspect(_width, _height, 320, 320);
ImagePtr medium = ImagePtr(mediumsize.width(), mediumsize.height());
uint64 photoId = rand_value<uint64>();
_photo = App::photoSet(photoId, 0, 0, unixtime(), _thumb, medium, ImagePtr(_width, _height));