2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Update API scheme on layer 151.

This commit is contained in:
John Preston
2022-12-26 14:23:53 +04:00
parent 673eb1090f
commit 627eba1c5a
3 changed files with 21 additions and 33 deletions

View File

@@ -1896,26 +1896,12 @@ void Updates::feedUpdate(const MTPUpdate &update) {
}
} break;
case mtpc_updateUserPhoto: {
auto &d = update.c_updateUserPhoto();
if (auto user = session().data().userLoaded(d.vuser_id())) {
user->setPhoto(d.vphoto());
user->loadUserpic();
// After that update we don't have enough information to
// create a 'photo' with all necessary fields. So if
// we receive second such update we end up with a 'photo_id'
// in user_photos list without a loaded 'photo'.
// It fails to show in media overview if you try to open it.
//
//if (mtpIsTrue(d.vprevious()) || !user->userpicPhotoId()) {
session().storage().remove(Storage::UserPhotosRemoveAfter(
peerToUser(user->id),
user->userpicPhotoId()));
//} else {
// session().storage().add(Storage::UserPhotosAddNew(
// peerToUser(user->id),
// user->userpicPhotoId()));
//}
case mtpc_updateUser: {
auto &d = update.c_updateUser();
if (const auto user = session().data().userLoaded(d.vuser_id())) {
if (user->wasFullUpdated()) {
user->updateFullForced();
}
}
} break;