2014-05-30 08:53:19 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2014-12-01 10:47:38 +00:00
|
|
|
the official desktop version of Telegram messaging app, see https://telegram.org
|
2014-05-30 08:53:19 +00:00
|
|
|
|
|
|
|
Telegram Desktop is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
It is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
2015-10-03 13:16:42 +00:00
|
|
|
In addition, as a special exception, the copyright holders give permission
|
|
|
|
to link the code of portions of this program with the OpenSSL library.
|
|
|
|
|
2014-05-30 08:53:19 +00:00
|
|
|
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
2016-02-08 10:56:18 +00:00
|
|
|
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
2014-05-30 08:53:19 +00:00
|
|
|
*/
|
|
|
|
#include "stdafx.h"
|
2016-04-21 17:57:29 +00:00
|
|
|
#include "intro/introsignup.h"
|
|
|
|
|
2016-10-28 12:44:28 +00:00
|
|
|
#include "styles/style_intro.h"
|
2016-10-31 12:29:26 +00:00
|
|
|
#include "styles/style_boxes.h"
|
2016-04-07 18:05:28 +00:00
|
|
|
#include "ui/filedialog.h"
|
2014-05-30 08:53:19 +00:00
|
|
|
#include "boxes/photocropbox.h"
|
2016-04-21 17:57:29 +00:00
|
|
|
#include "lang.h"
|
2014-05-30 08:53:19 +00:00
|
|
|
#include "application.h"
|
2016-11-04 19:50:35 +00:00
|
|
|
#include "ui/buttons/round_button.h"
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2016-03-14 16:59:18 +00:00
|
|
|
IntroSignup::IntroSignup(IntroWidget *parent) : IntroStep(parent)
|
2015-12-08 12:33:37 +00:00
|
|
|
, a_errorAlpha(0)
|
|
|
|
, a_photoOver(0)
|
|
|
|
, _a_error(animation(this, &IntroSignup::step_error))
|
|
|
|
, _a_photo(animation(this, &IntroSignup::step_photo))
|
2016-11-04 19:50:35 +00:00
|
|
|
, _next(this, lang(lng_intro_finish), st::introNextButton)
|
|
|
|
, _first(this, st::inpIntroName, lang(lng_signup_firstname))
|
|
|
|
, _last(this, st::inpIntroName, lang(lng_signup_lastname))
|
|
|
|
, _invertOrder(langFirstNameGoesSecond())
|
|
|
|
, _checkRequest(this) {
|
2014-05-30 08:53:19 +00:00
|
|
|
setVisible(false);
|
|
|
|
setGeometry(parent->innerRect());
|
|
|
|
|
2016-11-04 19:50:35 +00:00
|
|
|
_next->setTextTransform(Ui::RoundButton::TextTransform::ToUpper);
|
|
|
|
connect(_next, SIGNAL(clicked()), this, SLOT(onSubmitName()));
|
|
|
|
connect(_checkRequest, SIGNAL(timeout()), this, SLOT(onCheckRequest()));
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2015-09-23 17:43:08 +00:00
|
|
|
if (_invertOrder) {
|
2016-11-04 19:50:35 +00:00
|
|
|
setTabOrder(_last, _first);
|
2015-09-23 17:43:08 +00:00
|
|
|
}
|
|
|
|
|
2014-05-30 08:53:19 +00:00
|
|
|
setMouseTracking(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
void IntroSignup::mouseMoveEvent(QMouseEvent *e) {
|
2014-11-26 16:45:52 +00:00
|
|
|
bool photoOver = QRect(_phLeft, _phTop, st::introPhotoSize, st::introPhotoSize).contains(e->pos());
|
2014-05-30 08:53:19 +00:00
|
|
|
if (photoOver != _photoOver) {
|
|
|
|
_photoOver = photoOver;
|
|
|
|
if (_photoSmall.isNull()) {
|
2015-12-08 12:33:37 +00:00
|
|
|
a_photoOver.start(_photoOver ? 1 : 0);
|
|
|
|
_a_photo.start();
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
setCursor(_photoOver ? style::cur_pointer : style::cur_default);
|
|
|
|
}
|
|
|
|
|
|
|
|
void IntroSignup::mousePressEvent(QMouseEvent *e) {
|
|
|
|
mouseMoveEvent(e);
|
2014-11-26 16:45:52 +00:00
|
|
|
if (QRect(_phLeft, _phTop, st::introPhotoSize, st::introPhotoSize).contains(e->pos())) {
|
2014-05-30 08:53:19 +00:00
|
|
|
QStringList imgExtensions(cImgExtensions());
|
2016-08-05 09:18:02 +00:00
|
|
|
QString filter(qsl("Image files (*") + imgExtensions.join(qsl(" *")) + qsl(");;") + filedialogAllFilesFilter());
|
2014-05-30 08:53:19 +00:00
|
|
|
|
|
|
|
QImage img;
|
|
|
|
QString file;
|
|
|
|
QByteArray remoteContent;
|
|
|
|
if (filedialogGetOpenFile(file, remoteContent, lang(lng_choose_images), filter)) {
|
|
|
|
if (!remoteContent.isEmpty()) {
|
|
|
|
img = App::readImage(remoteContent);
|
|
|
|
} else {
|
|
|
|
if (!file.isEmpty()) {
|
|
|
|
img = App::readImage(file);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (img.isNull() || img.width() > 10 * img.height() || img.height() > 10 * img.width()) {
|
|
|
|
showError(lang(lng_bad_photo));
|
|
|
|
return;
|
|
|
|
}
|
2015-11-09 09:51:22 +00:00
|
|
|
PhotoCropBox *box = new PhotoCropBox(img, PeerId(0));
|
2014-05-30 08:53:19 +00:00
|
|
|
connect(box, SIGNAL(ready(const QImage &)), this, SLOT(onPhotoReady(const QImage &)));
|
2015-12-07 18:09:05 +00:00
|
|
|
Ui::showLayer(box);
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void IntroSignup::paintEvent(QPaintEvent *e) {
|
|
|
|
bool trivial = (rect() == e->rect());
|
|
|
|
|
2016-09-29 11:37:16 +00:00
|
|
|
Painter p(this);
|
2014-05-30 08:53:19 +00:00
|
|
|
if (!trivial) {
|
|
|
|
p.setClipRect(e->rect());
|
|
|
|
}
|
2016-11-04 19:50:35 +00:00
|
|
|
if (trivial || e->rect().intersects(_textRect)) {
|
2014-11-26 16:45:52 +00:00
|
|
|
p.setFont(st::introHeaderFont->f);
|
2016-11-04 19:50:35 +00:00
|
|
|
p.drawText(_textRect, lang(lng_signup_title), style::al_top);
|
2014-11-26 16:45:52 +00:00
|
|
|
p.setFont(st::introFont->f);
|
2016-11-04 19:50:35 +00:00
|
|
|
p.drawText(_textRect, lang(lng_signup_desc), style::al_bottom);
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
2015-12-08 12:33:37 +00:00
|
|
|
if (_a_error.animating() || error.length()) {
|
|
|
|
p.setOpacity(a_errorAlpha.current());
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2015-09-23 17:43:08 +00:00
|
|
|
QRect errRect;
|
|
|
|
if (_invertOrder) {
|
2016-11-04 19:50:35 +00:00
|
|
|
errRect = QRect((width() - st::introErrorWidth) / 2, (_first->y() + _first->height() + _next->y() - st::introErrorHeight) / 2, st::introErrorWidth, st::introErrorHeight);
|
2015-09-23 17:43:08 +00:00
|
|
|
} else {
|
2016-11-04 19:50:35 +00:00
|
|
|
errRect = QRect((width() - st::introErrorWidth) / 2, (_last->y() + _last->height() + _next->y() - st::introErrorHeight) / 2, st::introErrorWidth, st::introErrorHeight);
|
2015-09-23 17:43:08 +00:00
|
|
|
}
|
2016-10-31 12:29:26 +00:00
|
|
|
p.setFont(st::introErrorFont);
|
|
|
|
p.setPen(st::introErrorFg);
|
2014-05-30 08:53:19 +00:00
|
|
|
p.drawText(errRect, error, QTextOption(style::al_center));
|
|
|
|
|
|
|
|
p.setOpacity(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_photoSmall.isNull()) {
|
2016-09-29 11:37:16 +00:00
|
|
|
float64 o = a_photoOver.current();
|
|
|
|
QRect phRect(_phLeft, _phTop, st::introPhotoSize, st::introPhotoSize);
|
|
|
|
if (o > 0) {
|
|
|
|
if (o < 1) {
|
|
|
|
QColor c;
|
|
|
|
c.setRedF(st::newGroupPhotoBg->c.redF() * (1. - o) + st::newGroupPhotoBgOver->c.redF() * o);
|
|
|
|
c.setGreenF(st::newGroupPhotoBg->c.greenF() * (1. - o) + st::newGroupPhotoBgOver->c.greenF() * o);
|
|
|
|
c.setBlueF(st::newGroupPhotoBg->c.blueF() * (1. - o) + st::newGroupPhotoBgOver->c.blueF() * o);
|
|
|
|
p.fillRect(phRect, c);
|
|
|
|
} else {
|
|
|
|
p.fillRect(phRect, st::newGroupPhotoBgOver);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
p.fillRect(phRect, st::newGroupPhotoBg);
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
2016-10-27 21:19:38 +00:00
|
|
|
st::newGroupPhotoIcon.paintInCenter(p, phRect);
|
2014-05-30 08:53:19 +00:00
|
|
|
} else {
|
|
|
|
p.drawPixmap(_phLeft, _phTop, _photoSmall);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void IntroSignup::resizeEvent(QResizeEvent *e) {
|
2016-11-04 19:50:35 +00:00
|
|
|
_phLeft = (width() - _next->width()) / 2;
|
2014-11-26 16:45:52 +00:00
|
|
|
_phTop = st::introTextTop + st::introTextSize.height() + st::introCountry.top;
|
2014-05-30 08:53:19 +00:00
|
|
|
if (e->oldSize().width() != width()) {
|
2016-11-04 19:50:35 +00:00
|
|
|
_next->move((width() - _next->width()) / 2, st::introBtnTop);
|
2015-09-23 17:43:08 +00:00
|
|
|
if (_invertOrder) {
|
2016-11-04 19:50:35 +00:00
|
|
|
_last->move((width() - _next->width()) / 2 + _next->width() - _last->width(), _phTop);
|
|
|
|
_first->move((width() - _next->width()) / 2 + _next->width() - _first->width(), _last->y() + st::introCountry.height + st::introCountry.ptrSize.height() + st::introPhoneTop);
|
2015-09-23 17:43:08 +00:00
|
|
|
} else {
|
2016-11-04 19:50:35 +00:00
|
|
|
_first->move((width() - _next->width()) / 2 + _next->width() - _first->width(), _phTop);
|
|
|
|
_last->move((width() - _next->width()) / 2 + _next->width() - _last->width(), _first->y() + st::introCountry.height + st::introCountry.ptrSize.height() + st::introPhoneTop);
|
2015-09-23 17:43:08 +00:00
|
|
|
}
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
2016-11-04 19:50:35 +00:00
|
|
|
_textRect = QRect((width() - st::introTextSize.width()) / 2, st::introTextTop, st::introTextSize.width(), st::introTextSize.height());
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void IntroSignup::showError(const QString &err) {
|
2015-12-08 12:33:37 +00:00
|
|
|
if (!_a_error.animating() && err == error) return;
|
2014-05-30 08:53:19 +00:00
|
|
|
|
|
|
|
if (err.length()) {
|
|
|
|
error = err;
|
2015-12-08 12:33:37 +00:00
|
|
|
a_errorAlpha.start(1);
|
2014-05-30 08:53:19 +00:00
|
|
|
} else {
|
2015-12-08 12:33:37 +00:00
|
|
|
a_errorAlpha.start(0);
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
2015-12-08 12:33:37 +00:00
|
|
|
_a_error.start();
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
|
|
|
|
2015-12-08 12:33:37 +00:00
|
|
|
void IntroSignup::step_error(float64 ms, bool timer) {
|
2016-10-31 12:29:26 +00:00
|
|
|
float64 dt = ms / st::introErrorDuration;
|
2014-05-30 08:53:19 +00:00
|
|
|
|
|
|
|
if (dt >= 1) {
|
2015-12-08 12:33:37 +00:00
|
|
|
_a_error.stop();
|
|
|
|
a_errorAlpha.finish();
|
|
|
|
if (!a_errorAlpha.current()) {
|
2016-03-14 16:59:18 +00:00
|
|
|
error.clear();
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
|
|
|
} else {
|
2016-10-31 12:29:26 +00:00
|
|
|
a_errorAlpha.update(dt, anim::linear);
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
2015-12-08 12:33:37 +00:00
|
|
|
if (timer) update();
|
|
|
|
}
|
|
|
|
|
|
|
|
void IntroSignup::step_photo(float64 ms, bool timer) {
|
2016-10-31 12:29:26 +00:00
|
|
|
float64 dt = ms / st::introErrorDuration;
|
2015-12-08 12:33:37 +00:00
|
|
|
|
|
|
|
if (dt >= 1) {
|
|
|
|
_a_photo.stop();
|
|
|
|
a_photoOver.finish();
|
|
|
|
} else {
|
|
|
|
a_photoOver.update(dt, anim::linear);
|
|
|
|
}
|
|
|
|
if (timer) update();
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void IntroSignup::activate() {
|
2016-03-14 16:59:18 +00:00
|
|
|
IntroStep::activate();
|
2015-09-23 17:43:08 +00:00
|
|
|
if (_invertOrder) {
|
2016-11-04 19:50:35 +00:00
|
|
|
_last->setFocus();
|
2015-09-23 17:43:08 +00:00
|
|
|
} else {
|
2016-11-04 19:50:35 +00:00
|
|
|
_first->setFocus();
|
2015-09-23 17:43:08 +00:00
|
|
|
}
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
|
|
|
|
2016-03-14 16:59:18 +00:00
|
|
|
void IntroSignup::cancelled() {
|
2016-11-04 19:50:35 +00:00
|
|
|
if (_sentRequest) {
|
|
|
|
MTP::cancel(base::take(_sentRequest));
|
2016-03-14 16:59:18 +00:00
|
|
|
}
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void IntroSignup::stopCheck() {
|
2016-11-04 19:50:35 +00:00
|
|
|
_checkRequest->stop();
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void IntroSignup::onCheckRequest() {
|
2016-11-04 19:50:35 +00:00
|
|
|
int32 status = MTP::state(_sentRequest);
|
2014-05-30 08:53:19 +00:00
|
|
|
if (status < 0) {
|
|
|
|
int32 leftms = -status;
|
|
|
|
if (leftms >= 1000) {
|
2016-11-04 19:50:35 +00:00
|
|
|
MTP::cancel(base::take(_sentRequest));
|
|
|
|
if (!_first->isEnabled()) {
|
|
|
|
_first->setDisabled(false);
|
|
|
|
_last->setDisabled(false);
|
2015-09-23 17:43:08 +00:00
|
|
|
if (_invertOrder) {
|
2016-11-04 19:50:35 +00:00
|
|
|
_first->setFocus();
|
2015-09-23 17:43:08 +00:00
|
|
|
} else {
|
2016-11-04 19:50:35 +00:00
|
|
|
_last->setFocus();
|
2015-09-23 17:43:08 +00:00
|
|
|
}
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-11-04 19:50:35 +00:00
|
|
|
if (!_sentRequest && status == MTP::RequestSent) {
|
2014-05-30 08:53:19 +00:00
|
|
|
stopCheck();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void IntroSignup::onPhotoReady(const QImage &img) {
|
|
|
|
_photoBig = img;
|
2016-07-13 17:34:57 +00:00
|
|
|
_photoSmall = App::pixmapFromImageInPlace(img.scaled(st::introPhotoSize * cIntRetinaFactor(), st::introPhotoSize * cIntRetinaFactor(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
|
2015-09-16 13:04:08 +00:00
|
|
|
_photoSmall.setDevicePixelRatio(cRetinaFactor());
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void IntroSignup::nameSubmitDone(const MTPauth_Authorization &result) {
|
|
|
|
stopCheck();
|
2016-11-04 19:50:35 +00:00
|
|
|
_first->setDisabled(false);
|
|
|
|
_last->setDisabled(false);
|
2016-04-08 10:44:35 +00:00
|
|
|
const auto &d(result.c_auth_authorization());
|
2015-10-29 00:16:52 +00:00
|
|
|
if (d.vuser.type() != mtpc_user || !d.vuser.c_user().is_self()) { // wtf?
|
2014-05-30 08:53:19 +00:00
|
|
|
showError(lang(lng_server_error));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
intro()->finish(d.vuser, _photoBig);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IntroSignup::nameSubmitFail(const RPCError &error) {
|
2016-04-08 10:44:35 +00:00
|
|
|
if (MTP::isFloodError(error)) {
|
|
|
|
stopCheck();
|
2016-11-04 19:50:35 +00:00
|
|
|
_first->setDisabled(false);
|
|
|
|
_last->setDisabled(false);
|
2016-04-08 10:44:35 +00:00
|
|
|
showError(lang(lng_flood_error));
|
|
|
|
if (_invertOrder) {
|
2016-11-04 19:50:35 +00:00
|
|
|
_first->setFocus();
|
2016-04-08 10:44:35 +00:00
|
|
|
} else {
|
2016-11-04 19:50:35 +00:00
|
|
|
_last->setFocus();
|
2016-04-08 10:44:35 +00:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (MTP::isDefaultHandledError(error)) return false;
|
|
|
|
|
2014-05-30 08:53:19 +00:00
|
|
|
stopCheck();
|
2016-11-04 19:50:35 +00:00
|
|
|
_first->setDisabled(false);
|
|
|
|
_last->setDisabled(false);
|
2014-05-30 08:53:19 +00:00
|
|
|
const QString &err = error.type();
|
2016-04-08 10:44:35 +00:00
|
|
|
if (err == qstr("PHONE_NUMBER_INVALID") || err == qstr("PHONE_CODE_EXPIRED") ||
|
|
|
|
err == qstr("PHONE_CODE_EMPTY") || err == qstr("PHONE_CODE_INVALID") ||
|
|
|
|
err == qstr("PHONE_NUMBER_OCCUPIED")) {
|
2016-03-14 16:59:18 +00:00
|
|
|
intro()->onBack();
|
2014-05-30 08:53:19 +00:00
|
|
|
return true;
|
|
|
|
} else if (err == "FIRSTNAME_INVALID") {
|
|
|
|
showError(lang(lng_bad_name));
|
2016-11-04 19:50:35 +00:00
|
|
|
_first->setFocus();
|
2014-05-30 08:53:19 +00:00
|
|
|
return true;
|
|
|
|
} else if (err == "LASTNAME_INVALID") {
|
|
|
|
showError(lang(lng_bad_name));
|
2016-11-04 19:50:35 +00:00
|
|
|
_last->setFocus();
|
2014-05-30 08:53:19 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (cDebug()) { // internal server error
|
|
|
|
showError(err + ": " + error.description());
|
|
|
|
} else {
|
|
|
|
showError(lang(lng_server_error));
|
|
|
|
}
|
2015-09-23 17:43:08 +00:00
|
|
|
if (_invertOrder) {
|
2016-11-04 19:50:35 +00:00
|
|
|
_last->setFocus();
|
2015-09-23 17:43:08 +00:00
|
|
|
} else {
|
2016-11-04 19:50:35 +00:00
|
|
|
_first->setFocus();
|
2015-09-23 17:43:08 +00:00
|
|
|
}
|
2014-05-30 08:53:19 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void IntroSignup::onInputChange() {
|
2016-03-14 16:59:18 +00:00
|
|
|
showError(QString());
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void IntroSignup::onSubmitName(bool force) {
|
2015-09-23 17:43:08 +00:00
|
|
|
if (_invertOrder) {
|
2016-11-04 19:50:35 +00:00
|
|
|
if ((_last->hasFocus() || _last->text().trimmed().length()) && !_first->text().trimmed().length()) {
|
|
|
|
_first->setFocus();
|
2015-09-23 17:43:08 +00:00
|
|
|
return;
|
2016-11-04 19:50:35 +00:00
|
|
|
} else if (!_last->text().trimmed().length()) {
|
|
|
|
_last->setFocus();
|
2015-09-23 17:43:08 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
} else {
|
2016-11-04 19:50:35 +00:00
|
|
|
if ((_first->hasFocus() || _first->text().trimmed().length()) && !_last->text().trimmed().length()) {
|
|
|
|
_last->setFocus();
|
2015-09-23 17:43:08 +00:00
|
|
|
return;
|
2016-11-04 19:50:35 +00:00
|
|
|
} else if (!_first->text().trimmed().length()) {
|
|
|
|
_first->setFocus();
|
2015-09-23 17:43:08 +00:00
|
|
|
return;
|
|
|
|
}
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
2016-11-04 19:50:35 +00:00
|
|
|
if (!force && !_first->isEnabled()) return;
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2016-11-04 19:50:35 +00:00
|
|
|
_first->setDisabled(true);
|
|
|
|
_last->setDisabled(true);
|
2014-05-30 08:53:19 +00:00
|
|
|
setFocus();
|
|
|
|
|
2016-03-14 16:59:18 +00:00
|
|
|
showError(QString());
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2016-11-04 19:50:35 +00:00
|
|
|
_firstName = _first->text().trimmed();
|
|
|
|
_lastName = _last->text().trimmed();
|
|
|
|
_sentRequest = MTP::send(MTPauth_SignUp(MTP_string(intro()->getPhone()), MTP_string(intro()->getPhoneHash()), MTP_string(intro()->getCode()), MTP_string(_firstName), MTP_string(_lastName)), rpcDone(&IntroSignup::nameSubmitDone), rpcFail(&IntroSignup::nameSubmitFail));
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
|
|
|
|
2016-03-14 16:59:18 +00:00
|
|
|
void IntroSignup::onSubmit() {
|
2014-05-30 08:53:19 +00:00
|
|
|
onSubmitName();
|
|
|
|
}
|