void PhoneWidget::toSignUp() { hideError(); // Hide error, but leave the signup label visible. _checkRequest->start(1000); _sentRequest = MTP::send(MTPauth_SendCode(MTP_flags(0), MTP_string(_sentPhone), MTPBool(), MTP_int(ApiId), MTP_string(ApiHash)), rpcDone(&PhoneWidget::phoneSubmitDone), rpcFail(&PhoneWidget::phoneSubmitFail)); }
void PhoneWidget::submit() { if (_sentRequest || isHidden()) return; if (!App::isValidPhone(fullNumber())) { showPhoneError(langFactory(lng_bad_phone)); _phone->setFocus(); return; } hidePhoneError(); _checkRequest->start(1000); _sentPhone = fullNumber(); Messenger::Instance().mtp()->setUserPhone(_sentPhone); //_sentRequest = MTP::send(MTPauth_CheckPhone(MTP_string(_sentPhone)), rpcDone(&PhoneWidget::phoneCheckDone), rpcFail(&PhoneWidget::phoneSubmitFail)); _sentRequest = MTP::send( MTPauth_SendCode( MTP_flags(0), MTP_string(_sentPhone), MTPBool(), MTP_int(ApiId), MTP_string(ApiHash)), rpcDone(&PhoneWidget::phoneSubmitDone), rpcFail(&PhoneWidget::phoneSubmitFail)); }
void IntroPhone::toSignUp() { disableAll(); showError(QString()); checkRequest.start(1000); MTPauth_SendCode::Flags flags = 0; sentRequest = MTP::send(MTPauth_SendCode(MTP_flags(flags), MTP_string(sentPhone), MTPBool(), MTP_int(ApiId), MTP_string(ApiHash), MTP_string(Sandbox::LangSystemISO())), rpcDone(&IntroPhone::phoneSubmitDone), rpcFail(&IntroPhone::phoneSubmitFail)); }
void PhoneWidget::phoneCheckDone(const MTPauth_CheckedPhone &result) { stopCheck(); auto &d = result.c_auth_checkedPhone(); if (mtpIsTrue(d.vphone_registered)) { hidePhoneError(); _checkRequest->start(1000); _sentRequest = MTP::send(MTPauth_SendCode(MTP_flags(0), MTP_string(_sentPhone), MTPBool(), MTP_int(ApiId), MTP_string(ApiHash)), rpcDone(&PhoneWidget::phoneSubmitDone), rpcFail(&PhoneWidget::phoneSubmitFail)); } else { showSignup(); _sentRequest = 0; } }
void IntroPhone::phoneCheckDone(const MTPauth_CheckedPhone &result) { stopCheck(); const auto &d(result.c_auth_checkedPhone()); if (mtpIsTrue(d.vphone_registered)) { disableAll(); showError(QString()); checkRequest.start(1000); MTPauth_SendCode::Flags flags = 0; sentRequest = MTP::send(MTPauth_SendCode(MTP_flags(flags), MTP_string(sentPhone), MTPBool(), MTP_int(ApiId), MTP_string(ApiHash), MTP_string(Sandbox::LangSystemISO())), rpcDone(&IntroPhone::phoneSubmitDone), rpcFail(&IntroPhone::phoneSubmitFail)); } else { showError(lang(lng_bad_phone_noreg), true); enableAll(true); sentRequest = 0; } }
void ConfirmPhoneBox::checkPhoneAndHash() { if (_sendCodeRequestId) { return; } MTPaccount_SendConfirmPhoneCode::Flags flags = 0; _sendCodeRequestId = MTP::send(MTPaccount_SendConfirmPhoneCode(MTP_flags(flags), MTP_string(_hash), MTPBool()), rpcDone(&ConfirmPhoneBox::sendCodeDone), rpcFail(&ConfirmPhoneBox::sendCodeFail)); }