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

Fix sending of thumbnailed inline result GIFs.

This commit is contained in:
John Preston
2020-05-22 15:57:13 +04:00
parent 3c9ca2eb94
commit c61f3a0aba
6 changed files with 115 additions and 39 deletions

View File

@@ -453,6 +453,7 @@ DocumentData::DocumentData(not_null<Data::Session*> owner, DocumentId id)
DocumentData::~DocumentData() {
base::take(_thumbnailLoader).reset();
base::take(_videoThumbnailLoader).reset();
destroyLoader();
unload();
}
@@ -672,7 +673,9 @@ bool DocumentData::thumbnailFailed() const {
}
void DocumentData::loadThumbnail(Data::FileOrigin origin) {
if (_thumbnailLoader || (_flags & Flag::ThumbnailFailed)) {
if (_thumbnailLoader
|| (_flags & Flag::ThumbnailFailed)
|| !_thumbnailLocation.valid()) {
return;
} else if (const auto active = activeMediaView()) {
if (active->thumbnail()) {
@@ -728,7 +731,9 @@ bool DocumentData::videoThumbnailFailed() const {
}
void DocumentData::loadVideoThumbnail(Data::FileOrigin origin) {
if (_videoThumbnailLoader || (_flags & Flag::VideoThumbnailFailed)) {
if (_videoThumbnailLoader
|| (_flags & Flag::VideoThumbnailFailed)
|| !_videoThumbnailLocation.valid()) {
return;
} else if (const auto active = activeMediaView()) {
if (!active->videoThumbnailContent().isEmpty()) {