2015-04-02 10:33:19 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop version of Telegram messaging app, see https://telegram.org
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
2015-04-02 10:33: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
|
2015-04-02 10:33:19 +00:00
|
|
|
*/
|
|
|
|
#include "stdafx.h"
|
2016-03-16 11:54:37 +00:00
|
|
|
#include "intro/intropwdcheck.h"
|
|
|
|
|
2015-04-02 10:33:19 +00:00
|
|
|
#include "lang.h"
|
2016-04-07 18:05:28 +00:00
|
|
|
#include "ui/style.h"
|
|
|
|
#include "ui/filedialog.h"
|
2015-04-02 10:33:19 +00:00
|
|
|
#include "boxes/confirmbox.h"
|
|
|
|
|
|
|
|
#include "application.h"
|
|
|
|
|
2016-03-16 11:54:37 +00:00
|
|
|
#include "intro/introsignup.h"
|
2015-04-02 10:33:19 +00:00
|
|
|
|
2016-03-14 16:59:18 +00:00
|
|
|
IntroPwdCheck::IntroPwdCheck(IntroWidget *parent) : IntroStep(parent)
|
2015-12-08 12:33:37 +00:00
|
|
|
, a_errorAlpha(0)
|
|
|
|
, _a_error(animation(this, &IntroPwdCheck::step_error))
|
|
|
|
, _next(this, lang(lng_intro_submit), st::btnIntroNext)
|
|
|
|
, _salt(parent->getPwdSalt())
|
|
|
|
, _hasRecovery(parent->getHasRecovery())
|
|
|
|
, _hint(parent->getPwdHint())
|
|
|
|
, _pwdField(this, st::inpIntroPassword, lang(lng_signin_password))
|
|
|
|
, _codeField(this, st::inpIntroPassword, lang(lng_signin_code))
|
|
|
|
, _toRecover(this, lang(lng_signin_recover))
|
|
|
|
, _toPassword(this, lang(lng_signin_try_password))
|
|
|
|
, _reset(this, lang(lng_signin_reset_account), st::btnRedLink)
|
|
|
|
, sentRequest(0) {
|
2015-04-02 10:33:19 +00:00
|
|
|
setVisible(false);
|
|
|
|
setGeometry(parent->innerRect());
|
|
|
|
|
|
|
|
connect(&_next, SIGNAL(clicked()), this, SLOT(onSubmitPwd()));
|
|
|
|
connect(&checkRequest, SIGNAL(timeout()), this, SLOT(onCheckRequest()));
|
|
|
|
connect(&_toRecover, SIGNAL(clicked()), this, SLOT(onToRecover()));
|
|
|
|
connect(&_toPassword, SIGNAL(clicked()), this, SLOT(onToPassword()));
|
|
|
|
connect(&_pwdField, SIGNAL(changed()), this, SLOT(onInputChange()));
|
|
|
|
connect(&_codeField, SIGNAL(changed()), this, SLOT(onInputChange()));
|
2015-04-04 20:01:34 +00:00
|
|
|
connect(&_reset, SIGNAL(clicked()), this, SLOT(onReset()));
|
2015-04-02 10:33:19 +00:00
|
|
|
|
|
|
|
_pwdField.setEchoMode(QLineEdit::Password);
|
|
|
|
|
|
|
|
if (!_hint.isEmpty()) {
|
|
|
|
_hintText.setText(st::introFont, lng_signin_hint(lt_password_hint, _hint));
|
|
|
|
}
|
|
|
|
_codeField.hide();
|
|
|
|
_toPassword.hide();
|
2015-04-04 20:01:34 +00:00
|
|
|
_toRecover.show();
|
|
|
|
_reset.hide();
|
2015-04-02 10:33:19 +00:00
|
|
|
|
|
|
|
setMouseTracking(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
void IntroPwdCheck::paintEvent(QPaintEvent *e) {
|
|
|
|
bool trivial = (rect() == e->rect());
|
|
|
|
|
|
|
|
QPainter p(this);
|
|
|
|
if (!trivial) {
|
|
|
|
p.setClipRect(e->rect());
|
|
|
|
}
|
|
|
|
if (trivial || e->rect().intersects(textRect)) {
|
|
|
|
p.setFont(st::introHeaderFont->f);
|
|
|
|
p.drawText(textRect, lang(lng_signin_title), style::al_top);
|
|
|
|
p.setFont(st::introFont->f);
|
|
|
|
p.drawText(textRect, lang(_pwdField.isHidden() ? lng_signin_recover_desc : lng_signin_desc), style::al_bottom);
|
|
|
|
}
|
|
|
|
if (_pwdField.isHidden()) {
|
|
|
|
if (!_emailPattern.isEmpty()) {
|
|
|
|
p.drawText(QRect(textRect.x(), _pwdField.y() + _pwdField.height() + st::introFinishSkip, textRect.width(), st::introFont->height), _emailPattern, style::al_top);
|
|
|
|
}
|
|
|
|
} else if (!_hint.isEmpty()) {
|
|
|
|
_hintText.drawElided(p, _pwdField.x(), _pwdField.y() + _pwdField.height() + st::introFinishSkip, _pwdField.width(), 1, style::al_top);
|
|
|
|
}
|
2015-12-08 12:33:37 +00:00
|
|
|
if (_a_error.animating() || error.length()) {
|
|
|
|
p.setOpacity(a_errorAlpha.current());
|
2015-04-02 10:33:19 +00:00
|
|
|
|
|
|
|
QRect errRect((width() - st::introErrWidth) / 2, (_pwdField.y() + _pwdField.height() + st::introFinishSkip + st::introFont->height + _next.y() - st::introErrHeight) / 2, st::introErrWidth, st::introErrHeight);
|
|
|
|
p.setFont(st::introErrFont->f);
|
|
|
|
p.setPen(st::introErrColor->p);
|
|
|
|
p.drawText(errRect, error, QTextOption(style::al_center));
|
|
|
|
|
|
|
|
p.setOpacity(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void IntroPwdCheck::resizeEvent(QResizeEvent *e) {
|
|
|
|
if (e->oldSize().width() != width()) {
|
|
|
|
_next.move((width() - _next.width()) / 2, st::introBtnTop);
|
|
|
|
_pwdField.move((width() - _pwdField.width()) / 2, st::introTextTop + st::introTextSize.height() + st::introCountry.top);
|
|
|
|
_codeField.move((width() - _codeField.width()) / 2, st::introTextTop + st::introTextSize.height() + st::introCountry.top);
|
|
|
|
_toRecover.move(_next.x() + (_pwdField.width() - _toRecover.width()) / 2, _next.y() + _next.height() + st::introFinishSkip);
|
|
|
|
_toPassword.move(_next.x() + (_pwdField.width() - _toPassword.width()) / 2, _next.y() + _next.height() + st::introFinishSkip);
|
2015-04-04 20:01:34 +00:00
|
|
|
_reset.move((width() - _reset.width()) / 2, _toRecover.y() + _toRecover.height() + st::introFinishSkip);
|
2015-04-02 10:33:19 +00:00
|
|
|
}
|
|
|
|
textRect = QRect((width() - st::introTextSize.width()) / 2, st::introTextTop, st::introTextSize.width(), st::introTextSize.height());
|
|
|
|
}
|
|
|
|
|
|
|
|
void IntroPwdCheck::showError(const QString &err) {
|
2015-12-08 12:33:37 +00:00
|
|
|
if (!_a_error.animating() && err == error) return;
|
2015-04-02 10:33:19 +00:00
|
|
|
|
|
|
|
if (err.length()) {
|
|
|
|
error = err;
|
2015-12-08 12:33:37 +00:00
|
|
|
a_errorAlpha.start(1);
|
2015-04-02 10:33:19 +00:00
|
|
|
} else {
|
2015-12-08 12:33:37 +00:00
|
|
|
a_errorAlpha.start(0);
|
2015-04-02 10:33:19 +00:00
|
|
|
}
|
2015-12-08 12:33:37 +00:00
|
|
|
_a_error.start();
|
2015-04-02 10:33:19 +00:00
|
|
|
}
|
|
|
|
|
2015-12-08 12:33:37 +00:00
|
|
|
void IntroPwdCheck::step_error(float64 ms, bool timer) {
|
2015-04-02 10:33:19 +00:00
|
|
|
float64 dt = ms / st::introErrDuration;
|
|
|
|
|
|
|
|
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();
|
2015-04-02 10:33:19 +00:00
|
|
|
}
|
|
|
|
} else {
|
2015-12-08 12:33:37 +00:00
|
|
|
a_errorAlpha.update(dt, st::introErrFunc);
|
2015-04-02 10:33:19 +00:00
|
|
|
}
|
2015-12-08 12:33:37 +00:00
|
|
|
if (timer) update();
|
2015-04-02 10:33:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void IntroPwdCheck::activate() {
|
2016-03-14 16:59:18 +00:00
|
|
|
IntroStep::activate();
|
2015-04-02 10:33:19 +00:00
|
|
|
if (_pwdField.isHidden()) {
|
|
|
|
_codeField.setFocus();
|
|
|
|
} else {
|
|
|
|
_pwdField.setFocus();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-14 16:59:18 +00:00
|
|
|
void IntroPwdCheck::cancelled() {
|
|
|
|
if (sentRequest) {
|
|
|
|
MTP::cancel(sentRequest);
|
|
|
|
sentRequest = 0;
|
|
|
|
}
|
2015-04-02 10:33:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void IntroPwdCheck::stopCheck() {
|
|
|
|
checkRequest.stop();
|
|
|
|
}
|
|
|
|
|
|
|
|
void IntroPwdCheck::onCheckRequest() {
|
|
|
|
int32 status = MTP::state(sentRequest);
|
|
|
|
if (status < 0) {
|
|
|
|
int32 leftms = -status;
|
|
|
|
if (leftms >= 1000) {
|
|
|
|
MTP::cancel(sentRequest);
|
|
|
|
sentRequest = 0;
|
|
|
|
if (!_pwdField.isEnabled()) {
|
|
|
|
_pwdField.setDisabled(false);
|
|
|
|
_codeField.setDisabled(false);
|
|
|
|
activate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!sentRequest && status == MTP::RequestSent) {
|
|
|
|
stopCheck();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void IntroPwdCheck::pwdSubmitDone(bool recover, const MTPauth_Authorization &result) {
|
2015-04-04 20:01:34 +00:00
|
|
|
sentRequest = 0;
|
2015-04-02 10:33:19 +00:00
|
|
|
stopCheck();
|
|
|
|
if (recover) {
|
|
|
|
cSetPasswordRecovered(true);
|
|
|
|
}
|
|
|
|
_pwdField.setDisabled(false);
|
|
|
|
_codeField.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?
|
2015-04-02 10:33:19 +00:00
|
|
|
showError(lang(lng_server_error));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
intro()->finish(d.vuser);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IntroPwdCheck::pwdSubmitFail(const RPCError &error) {
|
2016-04-08 10:44:35 +00:00
|
|
|
if (MTP::isFloodError(error)) {
|
|
|
|
sentRequest = 0;
|
|
|
|
stopCheck();
|
|
|
|
_codeField.setDisabled(false);
|
|
|
|
showError(lang(lng_flood_error));
|
|
|
|
_pwdField.setDisabled(false);
|
|
|
|
_pwdField.notaBene();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (MTP::isDefaultHandledError(error)) return false;
|
|
|
|
|
2015-04-04 20:01:34 +00:00
|
|
|
sentRequest = 0;
|
2015-04-02 10:33:19 +00:00
|
|
|
stopCheck();
|
|
|
|
_pwdField.setDisabled(false);
|
|
|
|
_codeField.setDisabled(false);
|
|
|
|
const QString &err = error.type();
|
2016-04-08 10:44:35 +00:00
|
|
|
if (err == qstr("PASSWORD_HASH_INVALID")) {
|
2015-04-02 10:33:19 +00:00
|
|
|
showError(lang(lng_signin_bad_password));
|
2015-11-24 10:29:37 +00:00
|
|
|
_pwdField.selectAll();
|
2015-04-02 10:33:19 +00:00
|
|
|
_pwdField.notaBene();
|
|
|
|
return true;
|
2016-04-08 10:44:35 +00:00
|
|
|
} else if (err == qstr("PASSWORD_EMPTY")) {
|
2016-03-14 16:59:18 +00:00
|
|
|
intro()->onBack();
|
2015-04-02 10:33:19 +00:00
|
|
|
}
|
|
|
|
if (cDebug()) { // internal server error
|
|
|
|
showError(err + ": " + error.description());
|
|
|
|
} else {
|
|
|
|
showError(lang(lng_server_error));
|
|
|
|
}
|
|
|
|
_pwdField.setFocus();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IntroPwdCheck::codeSubmitFail(const RPCError &error) {
|
2016-04-08 10:44:35 +00:00
|
|
|
if (MTP::isFloodError(error)) {
|
|
|
|
showError(lang(lng_flood_error));
|
|
|
|
_codeField.notaBene();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (MTP::isDefaultHandledError(error)) return false;
|
|
|
|
|
2015-04-04 20:01:34 +00:00
|
|
|
sentRequest = 0;
|
2015-04-02 10:33:19 +00:00
|
|
|
stopCheck();
|
|
|
|
_pwdField.setDisabled(false);
|
|
|
|
_codeField.setDisabled(false);
|
|
|
|
const QString &err = error.type();
|
2016-04-08 10:44:35 +00:00
|
|
|
if (err == qstr("PASSWORD_EMPTY")) {
|
2016-03-14 16:59:18 +00:00
|
|
|
intro()->onBack();
|
2015-04-02 10:33:19 +00:00
|
|
|
return true;
|
2016-04-08 10:44:35 +00:00
|
|
|
} else if (err == qstr("PASSWORD_RECOVERY_NA")) {
|
2015-04-02 10:33:19 +00:00
|
|
|
recoverStartFail(error);
|
|
|
|
return true;
|
2016-04-08 10:44:35 +00:00
|
|
|
} else if (err == qstr("PASSWORD_RECOVERY_EXPIRED")) {
|
2015-04-02 10:33:19 +00:00
|
|
|
_emailPattern = QString();
|
|
|
|
onToPassword();
|
|
|
|
return true;
|
2016-04-08 10:44:35 +00:00
|
|
|
} else if (err == qstr("CODE_INVALID")) {
|
2015-04-02 10:33:19 +00:00
|
|
|
showError(lang(lng_signin_wrong_code));
|
2015-11-24 10:29:37 +00:00
|
|
|
_codeField.selectAll();
|
2015-04-04 20:01:34 +00:00
|
|
|
_codeField.notaBene();
|
2015-04-02 10:33:19 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (cDebug()) { // internal server error
|
|
|
|
showError(err + ": " + error.description());
|
|
|
|
} else {
|
|
|
|
showError(lang(lng_server_error));
|
|
|
|
}
|
|
|
|
_codeField.setFocus();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void IntroPwdCheck::recoverStarted(const MTPauth_PasswordRecovery &result) {
|
2015-10-03 10:09:09 +00:00
|
|
|
_emailPattern = st::introFont->elided(lng_signin_recover_hint(lt_recover_email, qs(result.c_auth_passwordRecovery().vemail_pattern)), textRect.width());
|
2015-04-02 10:33:19 +00:00
|
|
|
update();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IntroPwdCheck::recoverStartFail(const RPCError &error) {
|
|
|
|
stopCheck();
|
|
|
|
_pwdField.setDisabled(false);
|
|
|
|
_codeField.setDisabled(false);
|
|
|
|
_pwdField.show();
|
|
|
|
_codeField.hide();
|
|
|
|
_pwdField.setFocus();
|
|
|
|
update();
|
2016-03-14 16:59:18 +00:00
|
|
|
showError(QString());
|
2015-04-02 10:33:19 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void IntroPwdCheck::onToRecover() {
|
2015-04-04 20:01:34 +00:00
|
|
|
if (_hasRecovery) {
|
|
|
|
if (sentRequest) {
|
|
|
|
MTP::cancel(sentRequest);
|
|
|
|
sentRequest = 0;
|
|
|
|
}
|
2016-03-14 16:59:18 +00:00
|
|
|
showError(QString());
|
2015-04-04 20:01:34 +00:00
|
|
|
_toRecover.hide();
|
|
|
|
_toPassword.show();
|
|
|
|
_pwdField.hide();
|
|
|
|
_pwdField.setText(QString());
|
|
|
|
_codeField.show();
|
|
|
|
_codeField.setFocus();
|
|
|
|
if (_emailPattern.isEmpty()) {
|
|
|
|
MTP::send(MTPauth_RequestPasswordRecovery(), rpcDone(&IntroPwdCheck::recoverStarted), rpcFail(&IntroPwdCheck::recoverStartFail));
|
|
|
|
}
|
|
|
|
update();
|
|
|
|
} else {
|
2015-10-03 10:09:09 +00:00
|
|
|
ConfirmBox *box = new InformBox(lang(lng_signin_no_email_forgot));
|
2015-12-07 18:09:05 +00:00
|
|
|
Ui::showLayer(box);
|
2015-04-04 20:01:34 +00:00
|
|
|
connect(box, SIGNAL(destroyed(QObject*)), this, SLOT(onToReset()));
|
2015-04-02 10:33:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void IntroPwdCheck::onToPassword() {
|
2015-10-03 10:09:09 +00:00
|
|
|
ConfirmBox *box = new InformBox(lang(lng_signin_cant_email_forgot));
|
2015-12-07 18:09:05 +00:00
|
|
|
Ui::showLayer(box);
|
2015-04-04 20:01:34 +00:00
|
|
|
connect(box, SIGNAL(destroyed(QObject*)), this, SLOT(onToReset()));
|
|
|
|
}
|
|
|
|
|
|
|
|
void IntroPwdCheck::onToReset() {
|
|
|
|
if (sentRequest) {
|
|
|
|
MTP::cancel(sentRequest);
|
|
|
|
sentRequest = 0;
|
|
|
|
}
|
2015-04-02 10:33:19 +00:00
|
|
|
_toRecover.show();
|
|
|
|
_toPassword.hide();
|
|
|
|
_pwdField.show();
|
|
|
|
_codeField.hide();
|
|
|
|
_codeField.setText(QString());
|
|
|
|
_pwdField.setFocus();
|
2015-04-04 20:01:34 +00:00
|
|
|
_reset.show();
|
2015-04-02 10:33:19 +00:00
|
|
|
update();
|
|
|
|
}
|
|
|
|
|
2015-04-04 20:01:34 +00:00
|
|
|
void IntroPwdCheck::onReset() {
|
|
|
|
if (sentRequest) return;
|
2015-10-03 10:09:09 +00:00
|
|
|
ConfirmBox *box = new ConfirmBox(lang(lng_signin_sure_reset), lang(lng_signin_reset), st::attentionBoxButton);
|
2015-04-04 20:01:34 +00:00
|
|
|
connect(box, SIGNAL(confirmed()), this, SLOT(onResetSure()));
|
2015-12-07 18:09:05 +00:00
|
|
|
Ui::showLayer(box);
|
2015-04-04 20:01:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void IntroPwdCheck::onResetSure() {
|
|
|
|
if (sentRequest) return;
|
|
|
|
sentRequest = MTP::send(MTPaccount_DeleteAccount(MTP_string("Forgot password")), rpcDone(&IntroPwdCheck::deleteDone), rpcFail(&IntroPwdCheck::deleteFail));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IntroPwdCheck::deleteFail(const RPCError &error) {
|
2016-04-08 10:44:35 +00:00
|
|
|
if (MTP::isDefaultHandledError(error)) return false;
|
|
|
|
|
2015-04-04 20:01:34 +00:00
|
|
|
sentRequest = 0;
|
|
|
|
showError(lang(lng_server_error));
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void IntroPwdCheck::deleteDone(const MTPBool &v) {
|
2015-12-07 18:09:05 +00:00
|
|
|
Ui::hideLayer();
|
2016-03-16 11:54:37 +00:00
|
|
|
intro()->replaceStep(new IntroSignup(intro()));
|
2015-04-04 20:01:34 +00:00
|
|
|
}
|
|
|
|
|
2015-04-02 10:33:19 +00:00
|
|
|
void IntroPwdCheck::onInputChange() {
|
2016-03-14 16:59:18 +00:00
|
|
|
showError(QString());
|
2015-04-02 10:33:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void IntroPwdCheck::onSubmitPwd(bool force) {
|
2015-04-04 20:01:34 +00:00
|
|
|
if (sentRequest) return;
|
2015-04-02 10:33:19 +00:00
|
|
|
if (_pwdField.isHidden()) {
|
|
|
|
if (!force && !_codeField.isEnabled()) return;
|
|
|
|
QString code = _codeField.text().trimmed();
|
|
|
|
if (code.isEmpty()) {
|
|
|
|
_codeField.notaBene();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
sentRequest = MTP::send(MTPauth_RecoverPassword(MTP_string(code)), rpcDone(&IntroPwdCheck::pwdSubmitDone, true), rpcFail(&IntroPwdCheck::codeSubmitFail));
|
|
|
|
} else {
|
|
|
|
if (!force && !_pwdField.isEnabled()) return;
|
|
|
|
|
|
|
|
_pwdField.setDisabled(true);
|
|
|
|
setFocus();
|
|
|
|
|
2016-03-14 16:59:18 +00:00
|
|
|
showError(QString());
|
2015-04-02 10:33:19 +00:00
|
|
|
|
|
|
|
QByteArray pwdData = _salt + _pwdField.text().toUtf8() + _salt, pwdHash(32, Qt::Uninitialized);
|
|
|
|
hashSha256(pwdData.constData(), pwdData.size(), pwdHash.data());
|
2016-04-01 10:23:40 +00:00
|
|
|
sentRequest = MTP::send(MTPauth_CheckPassword(MTP_bytes(pwdHash)), rpcDone(&IntroPwdCheck::pwdSubmitDone, false), rpcFail(&IntroPwdCheck::pwdSubmitFail));
|
2015-04-02 10:33:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-14 16:59:18 +00:00
|
|
|
void IntroPwdCheck::onSubmit() {
|
2015-04-02 10:33:19 +00:00
|
|
|
onSubmitPwd();
|
|
|
|
}
|