Skip to content
Snippets Groups Projects
Commit 4152d391 authored by Oliver Wiese's avatar Oliver Wiese
Browse files

update reset function

parent be462914
Branches
No related tags found
No related merge requests found
...@@ -407,6 +407,7 @@ func parseMail(_ error: Error?, parser: MCOMessageParser?, message: MCOIMAPMessa ...@@ -407,6 +407,7 @@ func parseMail(_ error: Error?, parser: MCOMessageParser?, message: MCOIMAPMessa
autocrypt = AutocryptContact(header: header!) autocrypt = AutocryptContact(header: header!)
if(autocrypt?.type == EncryptionType.PGP && autocrypt?.key.characters.count > 0){ if(autocrypt?.type == EncryptionType.PGP && autocrypt?.key.characters.count > 0){
let pgp = ObjectivePGP.init() let pgp = ObjectivePGP.init()
print("Autocryptkey: \(autocrypt?.key) from \(header?.from.mailbox)")
pgp.importPublicKey(fromHeader: (autocrypt?.key)!, allowDuplicates: false) pgp.importPublicKey(fromHeader: (autocrypt?.key)!, allowDuplicates: false)
let enc = EnzevalosEncryptionHandler.getEncryption(EncryptionType.PGP) let enc = EnzevalosEncryptionHandler.getEncryption(EncryptionType.PGP)
do { do {
...@@ -516,23 +517,22 @@ func parseMail(_ error: Error?, parser: MCOMessageParser?, message: MCOIMAPMessa ...@@ -516,23 +517,22 @@ func parseMail(_ error: Error?, parser: MCOMessageParser?, message: MCOIMAPMessa
op?.start{ op?.start{
(err, vanished) -> Void in (err, vanished) -> Void in
guard err == nil else { guard err == nil else {
print("Error while fetching inbox: \(err)") print("Error while moving inbox: \(String(describing: err))")
return return
} }
} let mark = self.IMAPSession.storeFlagsOperation(withFolder: from, uids: uids, kind: MCOIMAPStoreFlagsRequestKind.add, flags: MCOMessageFlag.deleted)
let mark = self.IMAPSession.storeFlagsOperation(withFolder: from, uids: uids, kind: MCOIMAPStoreFlagsRequestKind.add, flags: MCOMessageFlag.deleted) mark?.start{ err -> Void in
mark?.start{ err -> Void in guard err == nil else {
guard err == nil else { print("Error while deleting inbox: \(String(describing: err))")
print("Error while fetching inbox: \(err)") return
return }
} let expunge = self.IMAPSession.expungeOperation(from)
} expunge?.start{err -> Void in
let expunge = self.IMAPSession.expungeOperation(from) guard err == nil else {
expunge?.start{ print("Error while expunging inbox: \(String(describing: err))")
err -> Void in return
guard err == nil else { }
print("Error while fetching inbox: \(err)") }
return
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment