diff --git a/enzevalos_iphone/DataHandler.swift b/enzevalos_iphone/DataHandler.swift index 6b16d02807191b22f1673c0381cc4df8f9d743d9..cb0142cebdc373ace69d2bd4f218e7e081b09cd4 100644 --- a/enzevalos_iphone/DataHandler.swift +++ b/enzevalos_iphone/DataHandler.swift @@ -218,6 +218,12 @@ class DataHandler { for key in keys { //let keyID = key.keyID! + if let mails = key.decryptedMails as? Set<PersistentMail> { + for mail in mails { + mail.decryptedKey = nil + } + } + delete(key: key) //seems to be unnecassary, because there already exists a corresponding pubilc key, if we generated a keypair //_ = DataHandler.handler.newPublicKey(keyID: keyID, cryptoType: .PGP, adr: adr, autocrypt: false, newGenerated: false) diff --git a/enzevalos_iphone/Folder+CoreDataProperties.swift b/enzevalos_iphone/Folder+CoreDataProperties.swift index daa80f283bdcc506c9d2d4ee94099dc0cbd810c8..f83885de0188b633bfc81164cc6d8d0dcee317a3 100644 --- a/enzevalos_iphone/Folder+CoreDataProperties.swift +++ b/enzevalos_iphone/Folder+CoreDataProperties.swift @@ -23,7 +23,7 @@ extension Folder { @NSManaged public var path: String //backendFolderPath @NSManaged public var lastUpdate: Date? @NSManaged public var pseudonym: String - @NSManaged public var icon: String + @NSManaged public var icon: String? public var uidvalidity: UInt32? { set { diff --git a/enzevalos_iphone/KeyRecord+CoreDataProperties.swift b/enzevalos_iphone/KeyRecord+CoreDataProperties.swift index 2cbc65b7293c4bbc9cd24127fca359f8bdfee1f2..c5db5bae807b8b5c34b36f2ce552f7912f40d184 100644 --- a/enzevalos_iphone/KeyRecord+CoreDataProperties.swift +++ b/enzevalos_iphone/KeyRecord+CoreDataProperties.swift @@ -29,7 +29,7 @@ extension KeyRecord { } @NSManaged public var contact: EnzevalosContact - @NSManaged public var folder: Folder + @NSManaged public var folder: Folder? @NSManaged public var key: PersistentKey? @NSManaged public var persistentMails: NSSet? diff --git a/enzevalos_iphone/Mail_Address+CoreDataProperties.swift b/enzevalos_iphone/Mail_Address+CoreDataProperties.swift index 62284dc815d16aca37cd325868e2efd3e2dd7f75..42da725c3a4c298a325520a851c436b4d4428ca3 100644 --- a/enzevalos_iphone/Mail_Address+CoreDataProperties.swift +++ b/enzevalos_iphone/Mail_Address+CoreDataProperties.swift @@ -35,7 +35,7 @@ extension Mail_Address { @NSManaged public var from: NSSet? @NSManaged public var to: NSSet? @NSManaged public var pseudonym: String - @NSManaged public var primaryKeyID: String + @NSManaged public var primaryKeyID: String? @NSManaged public var keys: NSSet? @NSManaged public var invitations: Int16 diff --git a/enzevalos_iphone/PersistentKey+CoreDataProperties.swift b/enzevalos_iphone/PersistentKey+CoreDataProperties.swift index 65f0d6b0539ffc6340142516173a770ef6d57721..db9cc8a363afcd947fedf96728dd2ed98b855626 100644 --- a/enzevalos_iphone/PersistentKey+CoreDataProperties.swift +++ b/enzevalos_iphone/PersistentKey+CoreDataProperties.swift @@ -82,7 +82,7 @@ extension PersistentKey { // MARK: Generated accessors for mailaddress extension PersistentKey { - @objc(addsignedMailsObject:) + @objc(addSignedMailsObject:) @NSManaged public func addSignedMails(_ value: PersistentMail) @objc(removeSignedMailsObject:) diff --git a/enzevalos_iphone/PersistentMail +CoreDataProperties.swift b/enzevalos_iphone/PersistentMail +CoreDataProperties.swift index 1b45811f1fb9eb6c3316d73184957d7599739f65..6c6b274a918a7cabe149265d6143927972a88bb3 100644 --- a/enzevalos_iphone/PersistentMail +CoreDataProperties.swift +++ b/enzevalos_iphone/PersistentMail +CoreDataProperties.swift @@ -84,6 +84,7 @@ extension PersistentMail { @NSManaged public var gmailThreadID: NSNumber? @NSManaged public var messageID: String? @NSManaged public var notLoadedMessages: String? + @NSManaged public var decryptedKey: PersistentKey? @NSManaged public var xMailer: String? diff --git a/enzevalos_iphone/enzevalos_iphone.xcdatamodeld/enzevalos_iphone 4.xcdatamodel/contents b/enzevalos_iphone/enzevalos_iphone.xcdatamodeld/enzevalos_iphone 4.xcdatamodel/contents index 9c24be69a9f3f5bc61b4844a88ef3e45662a7678..9d8e3e734d83930e62b68c035bd3d458c4da68a4 100644 --- a/enzevalos_iphone/enzevalos_iphone.xcdatamodeld/enzevalos_iphone 4.xcdatamodel/contents +++ b/enzevalos_iphone/enzevalos_iphone.xcdatamodeld/enzevalos_iphone 4.xcdatamodel/contents @@ -20,7 +20,7 @@ <attribute name="contentID" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/> <attribute name="data" attributeType="Binary" syncable="YES"/> <attribute name="encryptionState" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/> - <attribute name="isExplicitAttachment" attributeType="Boolean" usesScalarValueType="YES" syncable="YES"/> + <attribute name="isExplicitAttachment" optional="YES" attributeType="Boolean" usesScalarValueType="YES" syncable="YES"/> <attribute name="mcoPartType" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/> <attribute name="mimeType" attributeType="String" syncable="YES"/> <attribute name="name" attributeType="String" syncable="YES"/> @@ -87,7 +87,7 @@ <relationship name="signedMails" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="PersistentMail" inverseName="signedKey" inverseEntity="PersistentMail" syncable="YES"/> </entity> <entity name="PersistentMail" representedClassName="PersistentMail" syncable="YES"> - <attribute name="body" attributeType="String" syncable="YES"/> + <attribute name="body" optional="YES" attributeType="String" syncable="YES"/> <attribute name="date" attributeType="Date" defaultDateTimeInterval="-31582140" usesScalarValueType="NO" syncable="YES"/> <attribute name="decryptedBody" optional="YES" attributeType="String" syncable="YES"/> <attribute name="decrytionCode" optional="YES" attributeType="String" syncable="YES"/> @@ -120,7 +120,7 @@ <relationship name="decryptedKey" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="SecretKey" inverseName="decryptedMails" inverseEntity="SecretKey" syncable="YES"/> <relationship name="folder" maxCount="1" deletionRule="Nullify" destinationEntity="Folder" inverseName="mails" inverseEntity="Folder" syncable="YES"/> <relationship name="from" maxCount="1" deletionRule="Nullify" destinationEntity="Mail_Address" inverseName="from" inverseEntity="Mail_Address" syncable="YES"/> - <relationship name="record" maxCount="1" deletionRule="Nullify" destinationEntity="KeyRecord" inverseName="persistentMails" inverseEntity="KeyRecord" syncable="YES"/> + <relationship name="record" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="KeyRecord" inverseName="persistentMails" inverseEntity="KeyRecord" syncable="YES"/> <relationship name="referenceMails" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="PersistentMail" inverseName="referenceMails" inverseEntity="PersistentMail" syncable="YES"/> <relationship name="signedKey" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="PersistentKey" inverseName="signedMails" inverseEntity="PersistentKey" syncable="YES"/> <relationship name="to" toMany="YES" deletionRule="Nullify" destinationEntity="Mail_Address" inverseName="to" inverseEntity="Mail_Address" syncable="YES"/> @@ -130,7 +130,7 @@ </entity> <entity name="SecretKey" representedClassName="SecretKey" syncable="YES" codeGenerationType="class"> <attribute name="exported" optional="YES" attributeType="Boolean" usesScalarValueType="YES" syncable="YES"/> - <attribute name="importedDate" attributeType="Date" usesScalarValueType="NO" syncable="YES"/> + <attribute name="importedDate" optional="YES" attributeType="Date" usesScalarValueType="NO" syncable="YES"/> <attribute name="keyID" optional="YES" attributeType="String" syncable="YES"/> <attribute name="obsolete" optional="YES" attributeType="Boolean" usesScalarValueType="YES" syncable="YES"/> <relationship name="account" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="Account" inverseName="keys" inverseEntity="Account" syncable="YES"/>