MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / checkSubmitFail

Method checkSubmitFail

Telegram/SourceFiles/boxes/passcode_box.cpp:1363–1394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1361}
1362
1363void RecoverBox::checkSubmitFail(const MTP::Error &error) {
1364 if (MTP::IsFloodError(error)) {
1365 _submitRequest = 0;
1366 setError(tr::lng_flood_error(tr::now));
1367 _recoverCode->showError();
1368 return;
1369 }
1370 _submitRequest = 0;
1371
1372 const QString &err = error.type();
1373 if (err == u"PASSWORD_EMPTY"_q) {
1374 _newPasswordSet.fire(QByteArray());
1375 getDelegate()->show(
1376 Ui::MakeInformBox(tr::lng_cloud_password_removed()),
1377 Ui::LayerOption::CloseOther);
1378 } else if (err == u"PASSWORD_RECOVERY_NA"_q) {
1379 closeBox();
1380 } else if (err == u"PASSWORD_RECOVERY_EXPIRED"_q) {
1381 _recoveryExpired.fire({});
1382 closeBox();
1383 } else if (err == u"CODE_INVALID"_q) {
1384 setError(tr::lng_signin_wrong_code(tr::now));
1385 _recoverCode->selectAll();
1386 _recoverCode->setFocus();
1387 _recoverCode->showError();
1388 } else {
1389 setError(Logs::DebugEnabled() // internal server error
1390 ? (err + ": " + error.description())
1391 : Lang::Hard::ServerError());
1392 _recoverCode->setFocus();
1393 }
1394}
1395
1396RecoveryEmailValidation ConfirmRecoveryEmail(
1397 not_null<Main::Session*> session,

Callers

nothing calls this directly

Calls 11

IsFloodErrorFunction · 0.85
QByteArrayClass · 0.85
MakeInformBoxFunction · 0.85
DebugEnabledFunction · 0.85
ServerErrorFunction · 0.85
showErrorMethod · 0.45
typeMethod · 0.45
fireMethod · 0.45
showMethod · 0.45
setFocusMethod · 0.45
descriptionMethod · 0.45

Tested by

no test coverage detected