2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Don't hold session pointer in Data::CloudImage.

This commit is contained in:
John Preston
2020-05-28 17:51:18 +04:00
parent 29a498b959
commit 249f7813c1
11 changed files with 81 additions and 53 deletions

View File

@@ -73,12 +73,14 @@ void UserData::setIsContact(bool is) {
// see Local::readPeer as well
void UserData::setPhoto(const MTPUserProfilePhoto &photo) {
if (photo.type() == mtpc_userProfilePhoto) {
const auto &data = photo.c_userProfilePhoto();
updateUserpic(data.vphoto_id().v, data.vdc_id().v, data.vphoto_small());
} else {
photo.match([&](const MTPDuserProfilePhoto &data) {
updateUserpic(
data.vphoto_id().v,
data.vdc_id().v,
data.vphoto_small());
}, [&](const MTPDuserProfilePhotoEmpty &) {
clearUserpic();
}
});
}
auto UserData::unavailableReasons() const