marinofaggiana há 5 anos atrás
pai
commit
fa4bc142ac
2 ficheiros alterados com 7 adições e 7 exclusões
  1. 2 2
      iOSClient/Main/CCMain.m
  2. 5 5
      iOSClient/Networking/NCCommunication.swift

+ 2 - 2
iOSClient/Main/CCMain.m

@@ -1227,9 +1227,9 @@
     
 #ifdef DEBUG
     
-    [[NCCommunication sharedInstance] readFolderWithPath:serverUrl user:appDelegate.activeUserID password:appDelegate.activePassword completionHandler:^(NSArray<NCFile *> *files, NSError *error) {
+    [[NCCommunication sharedInstance] readFolderWithServerUrl:serverUrl account:appDelegate.activeAccount user:appDelegate.activeUserID  password:appDelegate.activePassword completionHandler:^(NSArray<NCFile *> *files, NSString *account, NSError *error) {
         for (NCFile *file in files) {
-            NSLog(file.etag);
+            //NSLog(file.etag);
         }
         NSLog(@"end");
     }];

+ 5 - 5
iOSClient/Networking/NCCommunication.swift

@@ -58,14 +58,14 @@ class NCCommunication: NSObject {
     <trashbin-deletion-time xmlns=\"http://nextcloud.org/ns\"/>"
     """
     
-    @objc func readFolder(path: String, user: String, password: String, completionHandler: @escaping (_ result: [NCFile]?, _ error: Error?) -> Void) {
+    @objc func readFolder(serverUrl: String, account: String, user: String, password: String, completionHandler: @escaping (_ result: [NCFile]?, _ account: String,_ error: Error?) -> Void) {
         
         // URL
         var url: URLConvertible
         do {
-            try url = path.asURL()
+            try url = serverUrl.asURL()
         } catch _ {
-            completionHandler(nil, nil)
+            completionHandler(nil, account, nil)
             return
         }
         
@@ -84,7 +84,7 @@ class NCCommunication: NSObject {
         AF.request(url, method: method, parameters:[:], encoding: URLEncoding.httpBody, headers: headers, interceptor: nil).validate(statusCode: 200..<300).responseData { (response) in
             switch response.result {
             case.failure(let error):
-                completionHandler(nil, error)
+                completionHandler(nil, account, error)
             case .success( _):
                 var files = [NCFile]()
                 if let data = response.data {
@@ -115,7 +115,7 @@ class NCCommunication: NSObject {
                         files.append(file)
                     }
                 }
-                completionHandler(files, nil)
+                completionHandler(files, account, nil)
             }
         }
     }