Skip to content

Commit

Permalink
Fix file_reference repair for ChatFull/ChannelFull photos.
Browse files Browse the repository at this point in the history
  • Loading branch information
levlam committed Oct 16, 2021
1 parent ea97e2c commit 3abac23
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions td/telegram/ContactsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11221,6 +11221,7 @@ void ContactsManager::add_profile_photo_to_cache(UserId user_id, Photo &&photo)
if (user_photos->photos.empty() || user_photos->photos[0].id.get() != photo.id.get()) {
user_photos->photos.insert(user_photos->photos.begin(), photo);
user_photos->count++;
register_user_photo(u, user_id, user_photos->photos[0]);
}
} else {
user_photos->count++;
Expand All @@ -11234,6 +11235,7 @@ void ContactsManager::add_profile_photo_to_cache(UserId user_id, Photo &&photo)
if (user_full->photo != photo) {
user_full->photo = photo;
user_full->is_changed = true;
register_user_photo(u, user_id, photo);
}
update_user_full(user_full, user_id, "add_profile_photo_to_cache");
}
Expand Down Expand Up @@ -12160,7 +12162,7 @@ void ContactsManager::on_update_chat_full_photo(ChatFull *chat_full, ChatId chat
drop_chat_photos(chat_id, true, false, "on_update_chat_full_photo");
}

auto photo_file_ids = photo_get_file_ids(photo);
auto photo_file_ids = photo_get_file_ids(chat_full->photo);
if (chat_full->registered_photo_file_ids == photo_file_ids) {
return;
}
Expand Down Expand Up @@ -12197,7 +12199,7 @@ void ContactsManager::on_update_channel_full_photo(ChannelFull *channel_full, Ch
drop_channel_photos(channel_id, true, false, "on_update_channel_full_photo");
}

auto photo_file_ids = photo_get_file_ids(photo);
auto photo_file_ids = photo_get_file_ids(channel_full->photo);
if (channel_full->registered_photo_file_ids == photo_file_ids) {
return;
}
Expand Down

0 comments on commit 3abac23

Please sign in to comment.