diff --git a/enzevalos_iphone/mail/IncomingMail.swift b/enzevalos_iphone/mail/IncomingMail.swift index c7c22e729d3936f71f1f338078ec00168482912c..a19c2cdce48b943960ea97cbd2d953d72db8fb7d 100644 --- a/enzevalos_iphone/mail/IncomingMail.swift +++ b/enzevalos_iphone/mail/IncomingMail.swift @@ -267,8 +267,8 @@ class IncomingMail { } let encState = self.cryptoObj?.encryptionState.rawValue ?? 0 - var lastsignedDate: Date? = nil // TODO: Remove from PublicKeyProperty -> Update this in Record file... - if let sigState = self.cryptoObj?.signatureState, sigState == .ValidSignature { + var lastsignedDate: Date? = nil + if let sigState = self.cryptoObj?.signatureState, sigState == .ValidSignature{ lastsignedDate = self.date } var usedAddr = [AddressProperties]() @@ -278,7 +278,11 @@ class IncomingMail { var autocryptPK = [PublicKeyProperties]() for fpr in newAutocrypPublicKeys { - let pk = PublicKeyProperties(fingerprint: fpr, cryptoProtocol: .PGP, origin: .AutocryptHeader, preferEncryption: autocrypt?.prefer_encryption, lastSeenInAutocryptHeader: date, lastSeenSignedMail: nil, secretKeyProperty: nil, usedAddresses: usedAddr) + var signed: Date? = nil + if let sigendKeys = self.cryptoObj?.signedKeys, sigendKeys.contains(fpr) { + signed = lastsignedDate + } + let pk = PublicKeyProperties(fingerprint: fpr, cryptoProtocol: .PGP, origin: .AutocryptHeader, preferEncryption: autocrypt?.prefer_encryption, lastSeenInAutocryptHeader: date, lastSeenSignedMail: signed, secretKeyProperty: nil, usedAddresses: usedAddr) autocryptPK.append(pk) }