From 6f4e31c9c3cf4fd185fe59a97e86a3f97ffe4b30 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 5 Jun 2019 18:50:42 +0300 Subject: [PATCH] Allow resending auth code in case of FLOOD_WAIT error. --- Telegram/SourceFiles/intro/introcode.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/intro/introcode.cpp b/Telegram/SourceFiles/intro/introcode.cpp index f1bda9383..0774dd7c1 100644 --- a/Telegram/SourceFiles/intro/introcode.cpp +++ b/Telegram/SourceFiles/intro/introcode.cpp @@ -348,6 +348,8 @@ void CodeWidget::onNoTelegramCode() { } void CodeWidget::noTelegramCodeDone(const MTPauth_SentCode &result) { + _noTelegramCodeRequestId = 0; + if (result.type() != mtpc_auth_sentCode) { showCodeError(&Lang::Hard::ServerError); return; @@ -369,11 +371,15 @@ void CodeWidget::noTelegramCodeDone(const MTPauth_SentCode &result) { bool CodeWidget::noTelegramCodeFail(const RPCError &error) { if (MTP::isFloodError(error)) { + _noTelegramCodeRequestId = 0; showCodeError(langFactory(lng_flood_error)); return true; } - if (MTP::isDefaultHandledError(error)) return false; + if (MTP::isDefaultHandledError(error)) { + return false; + } + _noTelegramCodeRequestId = 0; if (Logs::DebugEnabled()) { // internal server error auto text = error.type() + ": " + error.description(); showCodeError([text] { return text; });