diff --git a/Telegram/SourceFiles/api/api_updates.cpp b/Telegram/SourceFiles/api/api_updates.cpp index 8eb4a07cb9..f6caa032d4 100644 --- a/Telegram/SourceFiles/api/api_updates.cpp +++ b/Telegram/SourceFiles/api/api_updates.cpp @@ -1642,15 +1642,21 @@ void Updates::feedUpdate(const MTPUpdate &update) { if (auto user = session().data().userLoaded(d.vuser_id().v)) { user->setPhoto(d.vphoto()); user->loadUserpic(); - if (mtpIsTrue(d.vprevious()) || !user->userpicPhotoId()) { + // 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( user->bareId(), user->userpicPhotoId())); - } else { - session().storage().add(Storage::UserPhotosAddNew( - user->bareId(), - user->userpicPhotoId())); - } + //} else { + // session().storage().add(Storage::UserPhotosAddNew( + // user->bareId(), + // user->userpicPhotoId())); + //} } } break; diff --git a/Telegram/SourceFiles/data/data_peer.h b/Telegram/SourceFiles/data/data_peer.h index e3ab68e643..c6c9281a24 100644 --- a/Telegram/SourceFiles/data/data_peer.h +++ b/Telegram/SourceFiles/data/data_peer.h @@ -370,7 +370,7 @@ protected: void updateUserpic( PhotoId photoId, MTP::DcId dcId, - const MTPFileLocation &location); + const MTPFileLocation &small); void clearUserpic(); private: diff --git a/cmake b/cmake index 544e699b8f..408083f52e 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit 544e699b8fd201959f442e0f931e60fb82b31f43 +Subproject commit 408083f52e1815cd2a359aa3877185d48e82d4f9