Fix early return in ContactsManager::drop_user_photos.
This commit is contained in:
parent
4482ee461d
commit
1a2d1adb0c
@ -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;
|
||||
@ -12104,6 +12100,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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user