2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Clear DocumentMedia in ReplyPreview.

This commit is contained in:
John Preston
2020-05-21 15:40:10 +04:00
parent 44ec55b6a8
commit d64014c995
4 changed files with 22 additions and 8 deletions

View File

@@ -627,11 +627,13 @@ void DocumentData::updateThumbnails(
loadThumbnail(origin);
}
if (!thumbnail.bytes.isEmpty()) {
owner().cache().putIfEmpty(
_thumbnailLocation.file().cacheKey(),
Storage::Cache::Database::TaggedValue(
base::duplicate(thumbnail.bytes),
Data::kImageCacheTag));
if (const auto cacheKey = _thumbnailLocation.file().cacheKey()) {
owner().cache().putIfEmpty(
cacheKey,
Storage::Cache::Database::TaggedValue(
base::duplicate(thumbnail.bytes),
Data::kImageCacheTag));
}
}
}
}