Commit be222401 authored by Martin's avatar Martin
Browse files

IOS-2885 - works

parent 6ebe99ac
......@@ -226,17 +226,19 @@ extension VerifiableAccount {
Log.shared.errorAndCrash("Lost myself")
return
}
if let address = me.address, let cdAccount = CdAccount.by(address: address, context: Session.main.moc) {
let context = Session.main.moc
if let address = me.address,
let cdAccount = CdAccount.by(address: address, context: context) {
// Set the original passwords again to save it in Key Chain.
let account = cdAccount.account()
if let originalPassword = me.originalImapPassword {
account.moc.performAndWait {
context.performAndWait {
account.servers?.first(where: {$0.serverType == .imap})?.credentials.password = originalPassword
}
}
if let originalPassword = me.originalSmtpPassword {
account.moc.performAndWait {
account.servers?.first(where: {$0.serverType == .smtp})?.credentials.password = originalPassword
context.performAndWait {
account.servers?.first(where: {$0.serverType == .smtp})?.credentials = originalPassword
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment