mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
Fix userpic removing.
Regression was introduced in 68009b6fba
.
Fixes #4152.
This commit is contained in:
@@ -277,12 +277,7 @@ void PeerData::updateUserpic(
|
||||
const auto size = kUserpicSize;
|
||||
const auto loc = StorageImageLocation::FromMTP(size, size, location);
|
||||
const auto photo = loc.isNull() ? ImagePtr() : ImagePtr(loc);
|
||||
if (_userpicPhotoId != photoId
|
||||
|| _userpic.v() != photo.v()
|
||||
|| _userpicLocation != loc) {
|
||||
setUserpic(photoId, loc, photo);
|
||||
Notify::peerUpdatedDelayed(this, UpdateFlag::PhotoChanged);
|
||||
}
|
||||
setUserpicChecked(photoId, loc, photo);
|
||||
}
|
||||
|
||||
void PeerData::clearUserpic() {
|
||||
@@ -300,6 +295,19 @@ void PeerData::clearUserpic() {
|
||||
}
|
||||
return ImagePtr();
|
||||
}();
|
||||
setUserpicChecked(photoId, loc, photo);
|
||||
}
|
||||
|
||||
void PeerData::setUserpicChecked(
|
||||
PhotoId photoId,
|
||||
const StorageImageLocation &location,
|
||||
ImagePtr userpic) {
|
||||
if (_userpicPhotoId != photoId
|
||||
|| _userpic.v() != userpic.v()
|
||||
|| _userpicLocation != location) {
|
||||
setUserpic(photoId, location, userpic);
|
||||
Notify::peerUpdatedDelayed(this, UpdateFlag::PhotoChanged);
|
||||
}
|
||||
}
|
||||
|
||||
void PeerData::fillNames() {
|
||||
|
@@ -238,6 +238,11 @@ private:
|
||||
std::unique_ptr<Ui::EmptyUserpic> createEmptyUserpic() const;
|
||||
void refreshEmptyUserpic() const;
|
||||
|
||||
void setUserpicChecked(
|
||||
PhotoId photoId,
|
||||
const StorageImageLocation &location,
|
||||
ImagePtr userpic);
|
||||
|
||||
static constexpr auto kUnknownPhotoId = PhotoId(0xFFFFFFFFFFFFFFFFULL);
|
||||
|
||||
ImagePtr _userpic;
|
||||
|
Reference in New Issue
Block a user