2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 00:46:08 +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

@@ -615,13 +615,11 @@ void Widget::Step::finish(const MTPUser &user, QImage &&photo) {
App::wnd()->setupMain(&user);
// "this" is already deleted here by creating the main widget.
if (auto user = App::self()) {
if (const auto user = App::self()) {
Auth().api().requestFullPeer(user);
}
if (!photo.isNull()) {
Messenger::Instance().uploadProfilePhoto(
std::move(photo),
Auth().userId());
if (!photo.isNull()) {
Auth().api().uploadPeerPhoto(user, std::move(photo));
}
}
}