From 98982374eebd9f9bd953a2350c381087b7051bdd Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 27 May 2021 21:26:24 +0300 Subject: [PATCH] Don't store userProfilePhoto.stripped_thumb_. --- td/telegram/ContactsManager.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index 1652edea8..04b4f9ba3 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -10822,6 +10822,13 @@ void ContactsManager::on_update_user_photo(UserId user_id, tl_object_ptr &&photo, const char *source) { if (td_->auth_manager_->is_bot() && !G()->parameters().use_file_db && !u->is_photo_inited) { + if (photo != nullptr && photo->get_id() == telegram_api::userProfilePhoto::ID) { + auto *profile_photo = static_cast(photo.get()); + if ((profile_photo->flags_ & telegram_api::userProfilePhoto::STRIPPED_THUMB_MASK) != 0) { + profile_photo->flags_ -= telegram_api::userProfilePhoto::STRIPPED_THUMB_MASK; + profile_photo->stripped_thumb_ = BufferSlice(); + } + } auto &old_photo = pending_user_photos_[user_id]; if (!LOG_IS_STRIPPED(ERROR) && to_string(old_photo) == to_string(photo)) { return;