TF-2464 Save both EmailDelivery and EmailState in the keychain

Signed-off-by: dab246 <tdvu@linagora.com>
(cherry picked from commit a37fe7ea8bcc38eb96df39f46128c9e1f7af046e)
This commit is contained in:
dab246
2024-01-17 13:20:59 +07:00
committed by Dat PHAM HOANG
parent 642121dea3
commit 274e01d113
9 changed files with 74 additions and 40 deletions
@@ -6,6 +6,7 @@ struct KeychainSharingSession: Codable {
let authenticationType: AuthenticationType
let apiUrl: String
let emailState: String?
let emailDeliveryState: String?
let tokenOIDC: TokenOidc?
let basicAuth: String?
let tokenEndpoint: String?
@@ -13,13 +14,14 @@ struct KeychainSharingSession: Codable {
}
extension KeychainSharingSession {
func updateEmailState(newState: String) -> KeychainSharingSession {
func updateEmailDeliveryState(newEmailDeliveryState: String) -> KeychainSharingSession {
return KeychainSharingSession(
accountId: self.accountId,
userName: self.userName,
authenticationType: self.authenticationType,
apiUrl: self.apiUrl,
emailState: newState,
emailState: emailState,
emailDeliveryState: newEmailDeliveryState,
tokenOIDC: self.tokenOIDC,
basicAuth: self.basicAuth,
tokenEndpoint: self.tokenEndpoint,
@@ -34,6 +36,7 @@ extension KeychainSharingSession {
authenticationType: self.authenticationType,
apiUrl: self.apiUrl,
emailState: self.emailState,
emailDeliveryState: self.emailDeliveryState,
tokenOIDC: TokenOidc(
token: newTokenOidc.token,
tokenId: newTokenOidc.tokenId,