Marino Faggiana 7 жил өмнө
parent
commit
f4c6ba7dcd

+ 6 - 0
iOSClient/Security/NCEntoToEndInterface.swift

@@ -321,6 +321,9 @@ class NCEntoToEndInterface : NSObject, OCNetworkingDelegate  {
         
         var token: NSString?
         
+        // Remove all records e2eMetadata
+        NCManageDatabase.sharedInstance.deleteE2eEncryption(predicate: NSPredicate(format: "account = %@ AND serverUrl = %@", appDelegate.activeAccount, serverUrl))
+        
         if let error = NCNetworkingSync.sharedManager().markEnd(toEndFolderEncrypted: appDelegate.activeUser, userID: appDelegate.activeUserID, password: appDelegate.activePassword, url: url, fileID: fileID, token: &token) as NSError? {
             
             appDelegate.messageNotification("E2E Mark folder as encrypted", description: error.localizedDescription+" code \(error.code)", visible: true, delay: TimeInterval(k_dismissAfterSecond), type: TWMessageBarMessageType.error, errorCode: error.code)
@@ -335,6 +338,9 @@ class NCEntoToEndInterface : NSObject, OCNetworkingDelegate  {
         
         var token: NSString?
 
+        // Remove all records e2eMetadata
+        NCManageDatabase.sharedInstance.deleteE2eEncryption(predicate: NSPredicate(format: "account = %@ AND serverUrl = %@", appDelegate.activeAccount, serverUrl))
+        
         if let error = NCNetworkingSync.sharedManager().deletemarkEnd(toEndFolderEncrypted: appDelegate.activeUser, userID: appDelegate.activeUserID, password: appDelegate.activePassword, url: url, fileID: fileID, token: &token) as NSError? {
             
             appDelegate.messageNotification("E2E Remove mark folder as encrypted", description: error.localizedDescription+" code \(error.code)", visible: true, delay: TimeInterval(k_dismissAfterSecond), type: TWMessageBarMessageType.error, errorCode: error.code)