mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Add app outdated error
This commit is contained in:
@@ -12,6 +12,7 @@ public enum AuthorizationCodeRequestError {
|
||||
case phoneLimitExceeded
|
||||
case phoneBanned
|
||||
case timeout
|
||||
case appOutdated
|
||||
}
|
||||
|
||||
func switchToAuthorizedAccount(transaction: AccountManagerModifier<TelegramAccountManagerTypes>, account: UnauthorizedAccount) {
|
||||
@@ -230,6 +231,8 @@ public func sendAuthorizationCode(accountManager: AccountManager<TelegramAccount
|
||||
return .fail(.phoneLimitExceeded)
|
||||
} else if error.errorDescription == "PHONE_NUMBER_BANNED" {
|
||||
return .fail(.phoneBanned)
|
||||
} else if error.errorDescription == "UPDATE_APP_TO_LOGIN" {
|
||||
return .fail(.appOutdated)
|
||||
} else if error.errorDescription == "SESSION_PASSWORD_NEEDED" {
|
||||
return account.network.request(Api.functions.account.getPassword(), automaticFloodWait: false)
|
||||
|> mapError { error -> AuthorizationCodeRequestError in
|
||||
@@ -356,6 +359,8 @@ private func internalResendAuthorizationCode(accountManager: AccountManager<Tele
|
||||
return .phoneLimitExceeded
|
||||
} else if error.errorDescription == "PHONE_NUMBER_BANNED" {
|
||||
return .phoneBanned
|
||||
} else if error.errorDescription == "UPDATE_APP_TO_LOGIN" {
|
||||
return .appOutdated
|
||||
} else {
|
||||
return .generic(info: (Int(error.errorCode), error.errorDescription))
|
||||
}
|
||||
@@ -442,6 +447,8 @@ public func resendAuthorizationCode(accountManager: AccountManager<TelegramAccou
|
||||
return .phoneLimitExceeded
|
||||
} else if error.errorDescription == "PHONE_NUMBER_BANNED" {
|
||||
return .phoneBanned
|
||||
} else if error.errorDescription == "UPDATE_APP_TO_LOGIN" {
|
||||
return .appOutdated
|
||||
} else {
|
||||
return .generic(info: (Int(error.errorCode), error.errorDescription))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user