mirror of https://github.com/procxx/kepka.git
Allow resending auth code in case of FLOOD_WAIT error.
This commit is contained in:
parent
1290cda830
commit
6f4e31c9c3
|
@ -348,6 +348,8 @@ void CodeWidget::onNoTelegramCode() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CodeWidget::noTelegramCodeDone(const MTPauth_SentCode &result) {
|
void CodeWidget::noTelegramCodeDone(const MTPauth_SentCode &result) {
|
||||||
|
_noTelegramCodeRequestId = 0;
|
||||||
|
|
||||||
if (result.type() != mtpc_auth_sentCode) {
|
if (result.type() != mtpc_auth_sentCode) {
|
||||||
showCodeError(&Lang::Hard::ServerError);
|
showCodeError(&Lang::Hard::ServerError);
|
||||||
return;
|
return;
|
||||||
|
@ -369,11 +371,15 @@ void CodeWidget::noTelegramCodeDone(const MTPauth_SentCode &result) {
|
||||||
|
|
||||||
bool CodeWidget::noTelegramCodeFail(const RPCError &error) {
|
bool CodeWidget::noTelegramCodeFail(const RPCError &error) {
|
||||||
if (MTP::isFloodError(error)) {
|
if (MTP::isFloodError(error)) {
|
||||||
|
_noTelegramCodeRequestId = 0;
|
||||||
showCodeError(langFactory(lng_flood_error));
|
showCodeError(langFactory(lng_flood_error));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (MTP::isDefaultHandledError(error)) return false;
|
if (MTP::isDefaultHandledError(error)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
_noTelegramCodeRequestId = 0;
|
||||||
if (Logs::DebugEnabled()) { // internal server error
|
if (Logs::DebugEnabled()) { // internal server error
|
||||||
auto text = error.type() + ": " + error.description();
|
auto text = error.type() + ": " + error.description();
|
||||||
showCodeError([text] { return text; });
|
showCodeError([text] { return text; });
|
||||||
|
|
Loading…
Reference in New Issue