mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
Moved removeAuthInfo to "failed" state to prevent removing auth info when deactivating an account in CoreContext
This commit is contained in:
parent
b7446f6d26
commit
35f32d623c
1 changed files with 7 additions and 0 deletions
|
|
@ -277,12 +277,15 @@ final class CoreContext: ObservableObject {
|
|||
}
|
||||
case .Cleared:
|
||||
Log.info("[onAccountRegistrationStateChanged] Account \(account.displayName()) registration was cleared. Looking for auth info")
|
||||
// Moved removeAuthInfo to "failed" state to prevent removing auth info when deactivating an account
|
||||
/*
|
||||
if let authInfo = account.findAuthInfo() {
|
||||
Log.info("[onAccountRegistrationStateChanged] Found auth info for account, removing it")
|
||||
core.removeAuthInfo(info: authInfo)
|
||||
} else {
|
||||
Log.warn("[onAccountRegistrationStateChanged] Failed to find matching auth info for account")
|
||||
}
|
||||
*/
|
||||
case .Failed: // If registration failed, remove account from core
|
||||
if self.networkStatusIsConnected {
|
||||
let params = account.params
|
||||
|
|
@ -290,6 +293,10 @@ final class CoreContext: ObservableObject {
|
|||
clonedParams?.registerEnabled = false
|
||||
account.params = clonedParams
|
||||
|
||||
if let authInfo = account.findAuthInfo() {
|
||||
core.removeAuthInfo(info: authInfo)
|
||||
}
|
||||
|
||||
Log.warn("Registration failed for account \(account.displayName()), deleting it from core")
|
||||
core.removeAccount(account: account)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue