From 3c5b09bad705625945255b31c5f445002b6e3db1 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 12 Oct 2020 10:31:57 +0300 Subject: [PATCH] Hide photo sizes, which can't be downloaded. GitOrigin-RevId: 420860824f41d5fecbb935c756d9b6f0a2564cb7 --- td/telegram/Photo.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/td/telegram/Photo.cpp b/td/telegram/Photo.cpp index d99dcb8f6..2a8326294 100644 --- a/td/telegram/Photo.cpp +++ b/td/telegram/Photo.cpp @@ -585,6 +585,9 @@ static vector> get_photo_sizes_object(File return static_cast(lhs->width_) * static_cast(lhs->height_) < static_cast(rhs->width_) * static_cast(rhs->height_); }); + td::remove_if(sizes, [](const auto &size) { + return !size->photo_->local_->can_be_downloaded_ && !size->photo_->local_->is_downloading_completed_; + }); return sizes; }