mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
Update API scheme on layer 151.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user