2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-02 15:35:51 +00:00

Use Data::DocumentMedia to store good thumbnails.

This commit is contained in:
John Preston
2020-03-27 15:40:50 +04:00
parent 61647275e8
commit 7db53599e8
29 changed files with 545 additions and 168 deletions

View File

@@ -237,15 +237,7 @@ bool WebPageData::applyChanges(
}
void WebPageData::replaceDocumentGoodThumbnail() {
if (!document || !photo || !document->goodThumbnail()) {
return;
if (document && photo) {
document->setGoodThumbnailPhoto(photo);
}
const auto &location = photo->large()->location();
if (location.valid()) {
document->replaceGoodThumbnail(
std::make_unique<Images::StorageSource>(
location,
photo->large()->bytesSize()));
}
}