Marino Faggiana %!s(int64=7) %!d(string=hai) anos
pai
achega
f4c6ba7dcd
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      iOSClient/Security/NCEntoToEndInterface.swift

+ 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)