2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Move peer photo update from Messenger to ApiWrap.

This commit is contained in:
John Preston
2018-09-06 14:13:54 +03:00
parent e2207e33ef
commit 8c1cc51c2e
13 changed files with 190 additions and 230 deletions

View File

@@ -23,6 +23,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "window/window_controller.h"
#include "lang/lang_keys.h"
#include "auth_session.h"
#include "apiwrap.h"
#include "mainwidget.h"
#include "messenger.h"
#include "observer_peer.h"
@@ -478,14 +479,9 @@ void UserpicButton::changePhotoLazy() {
}
void UserpicButton::uploadNewPeerPhoto() {
auto callback = crl::guard(
this,
[this](QImage &&image) {
Messenger::Instance().uploadProfilePhoto(
std::move(image),
_peer->id
);
});
auto callback = crl::guard(this, [=](QImage &&image) {
Auth().api().uploadPeerPhoto(_peer, std::move(image));
});
ShowChoosePhotoBox(this, _peerForCrop, std::move(callback));
}