Marino Faggiana 7 жил өмнө
parent
commit
93bb5d192c

+ 1 - 6
iOSClient/Main/CCMain.m

@@ -4000,14 +4000,9 @@
                                        type:AHKActionSheetButtonTypeEncrypted
                                     handler:^(AHKActionSheet *as) {
                                         
-                                        /*
                                         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
-                                            [app.endToEndInterface markEndToEndFolderEncrypted:self.serverUrl fileID:_metadata.fileID token:nil];
+                                            [app.endToEndInterface markEndToEndFolderEncrypted:app.activeUrl fileID:_metadata.fileID token:nil];
                                         });
-                                        */
-                                        
-                                        [app.endToEndInterface lockEndToEndFolderEncrypted:_metadata];
-                                        
                                     }];
         }
         

+ 9 - 6
iOSClient/Security/NCEntoToEndInterface.swift

@@ -357,14 +357,17 @@ class NCEntoToEndInterface : NSObject, OCNetworkingDelegate  {
         }
     }
     
-    @objc func markEndToEndFolderEncrypted(_ metadata: tableMetadata) {
+    @objc func markEndToEndFolderEncrypted(_ url: String, fileID: String, token: String?) {
         
-        let metadataNet: CCMetadataNet = CCMetadataNet.init(account: appDelegate.activeAccount)
-
-        metadataNet.action = actionMarkEndToEndFolderEncrypted;
-        metadataNet.fileID = metadata.fileID;
+        guard let token = NCNetworkingSync.sharedManager().lockEnd(toEndFolderEncrypted: appDelegate.activeUser, userID: appDelegate.activeUserID, password: appDelegate.activePassword, url: url , fileID: fileID, token: token) else {
+            
+            return
+        }
+        
+        NCNetworkingSync.sharedManager().markEnd(toEndFolderEncrypted: appDelegate.activeUser, userID: appDelegate.activeUserID, password: appDelegate.activePassword, url: url, fileID: fileID)
+        
+        NCNetworkingSync.sharedManager().unlockEnd(toEndFolderEncrypted: appDelegate.activeUser, userID: appDelegate.activeUserID, password: appDelegate.activePassword, url: url, fileID: fileID, token: token)
         
-        appDelegate.addNetworkingOperationQueue(appDelegate.netQueue, delegate: self, metadataNet: metadataNet)        
     }
     
     func deletemarkEnd(toEndFolderEncryptedSuccess metadataNet: CCMetadataNet!) {