mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 22:46:10 +00:00
Set / suggest / reset a contact personal photo.
This commit is contained in:
@@ -54,11 +54,17 @@ void UserData::setIsContact(bool is) {
|
||||
// see Serialize::readPeer as well
|
||||
void UserData::setPhoto(const MTPUserProfilePhoto &photo) {
|
||||
photo.match([&](const MTPDuserProfilePhoto &data) {
|
||||
if (data.is_personal()) {
|
||||
addFlags(UserDataFlag::PersonalPhoto);
|
||||
} else {
|
||||
removeFlags(UserDataFlag::PersonalPhoto);
|
||||
}
|
||||
updateUserpic(
|
||||
data.vphoto_id().v,
|
||||
data.vdc_id().v,
|
||||
data.is_has_video());
|
||||
}, [&](const MTPDuserProfilePhotoEmpty &) {
|
||||
removeFlags(UserDataFlag::PersonalPhoto);
|
||||
clearUserpic();
|
||||
});
|
||||
}
|
||||
@@ -358,6 +364,9 @@ void ApplyUserUpdate(not_null<UserData*> user, const MTPDuserFull &update) {
|
||||
if (const auto photo = update.vprofile_photo()) {
|
||||
user->owner().processPhoto(*photo);
|
||||
}
|
||||
if (const auto photo = update.vpersonal_photo()) {
|
||||
user->owner().processPhoto(*photo);
|
||||
}
|
||||
user->setSettings(update.vsettings());
|
||||
user->owner().notifySettings().apply(user, update.vnotify_settings());
|
||||
|
||||
|
Reference in New Issue
Block a user