2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Replace NewAvatarButton with UserpicButton.

This new control should also replace PeerAvatarButton and
Profile::UserpicButton and deliver all the best of those three.
This commit is contained in:
John Preston
2017-11-13 16:02:53 +04:00
parent 3deea14559
commit 3d37ac9235
21 changed files with 525 additions and 257 deletions

View File

@@ -449,7 +449,7 @@ QString Widget::Step::nextButtonText() const {
return lang(lng_intro_next);
}
void Widget::Step::finish(const MTPUser &user, QImage photo) {
void Widget::Step::finish(const MTPUser &user, QImage &&photo) {
if (user.type() != mtpc_user || !user.c_user().is_self()) {
// No idea what to do here.
// We could've reset intro and MTP, but this really should not happen.
@@ -475,7 +475,9 @@ void Widget::Step::finish(const MTPUser &user, QImage photo) {
Auth().api().requestFullPeer(user);
}
if (!photo.isNull()) {
Messenger::Instance().uploadProfilePhoto(photo, Auth().userId());
Messenger::Instance().uploadProfilePhoto(
std::move(photo),
Auth().userId());
}
}