Fix early return in ContactsManager::drop_user_photos.

This commit is contained in:
levlam 2022-07-18 01:43:46 +03:00
parent 4482ee461d
commit 1a2d1adb0c

View File

@ -12076,21 +12076,17 @@ void ContactsManager::drop_user_photos(UserId user_id, bool is_empty, bool drop_
if (user_photos->count == new_count) {
CHECK(user_photos->photos.empty());
CHECK(user_photos->offset == user_photos->count);
return;
}
} else {
LOG(INFO) << "Drop photos of " << user_id << " to " << (is_empty ? "empty" : "unknown") << " from " << source;
user_photos->photos.clear();
user_photos->count = new_count;
user_photos->offset = user_photos->count;
}
}
if (drop_user_full_photo) {
auto user_full = get_user_full(user_id); // must not load UserFull
if (user_full == nullptr) {
return;
}
if (user_full != nullptr) {
if (!user_full->photo.is_empty()) {
user_full->photo = Photo();
user_full->is_changed = true;
@ -12105,6 +12101,7 @@ void ContactsManager::drop_user_photos(UserId user_id, bool is_empty, bool drop_
update_user_full(user_full, user_id, "drop_user_photos");
}
}
}
void ContactsManager::drop_user_full(UserId user_id) {
auto user_full = get_user_full_force(user_id);