diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index 325801f2..5f6ba98f 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -8116,7 +8116,7 @@ void ContactsManager::update_user(User *u, UserId user_id, bool from_binlog, boo add_user_photo_id(u, user_id, u->photo.id, dialog_photo_get_file_ids(u->photo)); - drop_user_photos(user_id, u->photo.id <= 0); + drop_user_photos(user_id, u->photo.id <= 0, "update_user"); } if (u->is_status_changed && user_id != get_my_id()) { auto left_time = get_user_was_online(u, user_id) - G()->server_time_cached(); @@ -8563,7 +8563,7 @@ void ContactsManager::on_get_user_full(tl_object_ptr &&u Photo photo = get_photo(td_->file_manager_.get(), std::move(user_full->profile_photo_), DialogId()); if (photo.id == -2) { - drop_user_photos(user_id, true); + drop_user_photos(user_id, true, "on_get_user_full"); } if (user_full->bot_info_ != nullptr) { if (on_update_bot_info(std::move(user_full->bot_info_), false)) { @@ -9062,7 +9062,7 @@ void ContactsManager::on_update_user_photo(User *u, UserId user_id, bool is_empty = photo == nullptr || photo->get_id() == telegram_api::userProfilePhotoEmpty::ID; pending_user_photos_[user_id] = std::move(photo); - drop_user_photos(user_id, is_empty); + drop_user_photos(user_id, is_empty, "on_update_user_photo"); return; } @@ -9341,7 +9341,7 @@ void ContactsManager::on_ignored_restriction_reasons_changed() { void ContactsManager::on_delete_profile_photo(int64 profile_photo_id, Promise promise) { UserId my_id = get_my_id(); - drop_user_photos(my_id, false); + drop_user_photos(my_id, false, "on_delete_profile_photo"); if (G()->close_flag()) { return promise.set_value(Unit()); @@ -9350,7 +9350,8 @@ void ContactsManager::on_delete_profile_photo(int64 profile_photo_id, Promisesecond; @@ -9365,7 +9366,7 @@ void ContactsManager::drop_user_photos(UserId user_id, bool is_empty) { } void ContactsManager::drop_user_full(UserId user_id) { - drop_user_photos(user_id, false); + drop_user_photos(user_id, false, "drop_user_full"); bot_infos_.erase(user_id); if (G()->parameters().use_chat_info_db) { diff --git a/td/telegram/ContactsManager.h b/td/telegram/ContactsManager.h index 07d42ca5..e9f4e07e 100644 --- a/td/telegram/ContactsManager.h +++ b/td/telegram/ContactsManager.h @@ -1074,7 +1074,7 @@ class ContactsManager : public Actor { void on_update_user_full_common_chat_count(UserFull *user_full, UserId user_id, int32 common_chat_count); void on_update_user_full_need_phone_number_privacy_exception(UserFull *user_full, UserId user_id, bool need_phone_number_privacy_exception); - void drop_user_photos(UserId user_id, bool is_empty); + void drop_user_photos(UserId user_id, bool is_empty, const char *source); void drop_user_full(UserId user_id); void on_set_user_is_blocked_failed(UserId user_id, bool is_blocked, Status error);