2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Set / suggest / reset a contact personal photo.

This commit is contained in:
John Preston
2022-12-09 16:34:34 +04:00
parent cb99d611f3
commit 5fe9c93cb6
12 changed files with 190 additions and 72 deletions

View File

@@ -138,13 +138,12 @@ Cover::Cover(
initViewers();
setupChildGeometry();
_userpic->switchChangePhotoOverlay(_user->isSelf());
_userpic->uploadPhotoRequests(
) | rpl::start_with_next([=] {
_user->session().api().peerPhoto().upload(
_user,
_userpic->takeResultImage());
}, _userpic->lifetime());
_userpic->switchChangePhotoOverlay(_user->isSelf(), [=](
Ui::UserpicButton::ChosenImage chosen) {
auto &image = chosen.image;
_userpic->changeTo(base::duplicate(image));
_user->session().api().peerPhoto().upload(_user, std::move(image));
});
_badge.setPremiumClickCallback([=] {
_emojiStatusPanel.show(