mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Support personal photo edit in EditContactBox.
This commit is contained in:
@@ -245,6 +245,7 @@ void SetupPhoto(
|
||||
controller,
|
||||
self,
|
||||
Ui::UserpicButton::Role::OpenPhoto,
|
||||
Ui::UserpicButton::Source::PeerPhoto,
|
||||
st::settingsInfoPhoto);
|
||||
const auto upload = CreateUploadSubButton(wrap, controller);
|
||||
|
||||
@@ -252,7 +253,7 @@ void SetupPhoto(
|
||||
) | rpl::start_with_next([=](Ui::UserpicButton::ChosenImage &&chosen) {
|
||||
auto &image = chosen.image;
|
||||
UpdatePhotoLocally(self, image);
|
||||
photo->changeTo(base::duplicate(image));
|
||||
photo->showCustom(base::duplicate(image));
|
||||
self->session().api().peerPhoto().upload(self, std::move(image));
|
||||
}, upload->lifetime());
|
||||
|
||||
|
@@ -123,6 +123,7 @@ Cover::Cover(
|
||||
controller,
|
||||
_user,
|
||||
Ui::UserpicButton::Role::OpenPhoto,
|
||||
Ui::UserpicButton::Source::PeerPhoto,
|
||||
st::infoProfileCover.photo)
|
||||
, _name(this, st::infoProfileCover.name)
|
||||
, _phone(this, st::defaultFlatLabel)
|
||||
@@ -141,7 +142,7 @@ Cover::Cover(
|
||||
_userpic->switchChangePhotoOverlay(_user->isSelf(), [=](
|
||||
Ui::UserpicButton::ChosenImage chosen) {
|
||||
auto &image = chosen.image;
|
||||
_userpic->changeTo(base::duplicate(image));
|
||||
_userpic->showCustom(base::duplicate(image));
|
||||
_user->session().api().peerPhoto().upload(_user, std::move(image));
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user