Allow resending auth code in case of FLOOD_WAIT error.

This commit is contained in:
John Preston 2019-06-05 18:50:42 +03:00
parent 1290cda830
commit 6f4e31c9c3
1 changed files with 7 additions and 1 deletions

View File

@ -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; });