marinofaggiana 5 年之前
父節點
當前提交
9fc8d193f5

+ 1 - 1
Cartfile.resolved

@@ -19,7 +19,7 @@ github "marinofaggiana/AFNetworking" "2967678c3e0e98c9b8d7e06222ad12d1f49c26f2"
 github "marinofaggiana/KTVHTTPCache" "2.0.2"
 github "marinofaggiana/KTVHTTPCache" "2.0.2"
 github "marinofaggiana/TOPasscodeViewController" "0.0.6"
 github "marinofaggiana/TOPasscodeViewController" "0.0.6"
 github "marinofaggiana/XLForm" "eb9381ad8129f60402bf412250fb31b95a628a08"
 github "marinofaggiana/XLForm" "eb9381ad8129f60402bf412250fb31b95a628a08"
-github "nextcloud/ios-communication-library" "129bb7b865ef72018499eb965fff2f3df36da2eb"
+github "nextcloud/ios-communication-library" "a36270cb792835106b996344a3e34737b586bc35"
 github "realm/realm-cocoa" "v4.4.1"
 github "realm/realm-cocoa" "v4.4.1"
 github "rechsteiner/Parchment" "v1.7.0"
 github "rechsteiner/Parchment" "v1.7.0"
 github "scenee/FloatingPanel" "v1.7.4"
 github "scenee/FloatingPanel" "v1.7.4"

+ 1 - 1
File Provider Extension/FileProviderEnumerator.swift

@@ -283,7 +283,7 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {
             fileNamePath = CCUtility.returnPathfromServerUrl(serverUrl, activeUrl: fileProviderData.sharedInstance.accountUrl)!
             fileNamePath = CCUtility.returnPathfromServerUrl(serverUrl, activeUrl: fileProviderData.sharedInstance.accountUrl)!
         }
         }
         
         
-        NCCommunication.shared.iosHelper(serverUrl: serverUrl, fileNamePath: fileNamePath, offset: offset, limit: limit, customUserAgent: nil, addCustomHeaders: nil, account: fileProviderData.sharedInstance.account) { (account, files, errorCode, errorDescription) in
+        NCCommunication.shared.iosHelper(fileNamePath: fileNamePath, offset: offset, limit: limit, customUserAgent: nil, addCustomHeaders: nil, account: fileProviderData.sharedInstance.account) { (account, files, errorCode, errorDescription) in
             
             
              if errorCode == 0 && files != nil  && files!.count >= 1 {
              if errorCode == 0 && files != nil  && files!.count >= 1 {
                                 
                                 

+ 1 - 1
File Provider Extension/FileProviderExtension+Actions.swift

@@ -240,7 +240,7 @@ extension FileProviderExtension {
         if (favorite == true && metadata.favorite == false) || (favorite == false && metadata.favorite == true) {
         if (favorite == true && metadata.favorite == false) || (favorite == false && metadata.favorite == true) {
             let fileNamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, activeUrl: fileProviderData.sharedInstance.accountUrl)!
             let fileNamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, activeUrl: fileProviderData.sharedInstance.accountUrl)!
             
             
-            NCCommunication.shared.setFavorite(serverUrl: fileProviderData.sharedInstance.accountUrl, fileName: fileNamePath, favorite: favorite, customUserAgent: nil, addCustomHeaders: nil, account: fileProviderData.sharedInstance.account) { (account, errorCode, errorDescription) in
+            NCCommunication.shared.setFavorite(fileName: fileNamePath, favorite: favorite, customUserAgent: nil, addCustomHeaders: nil, account: fileProviderData.sharedInstance.account) { (account, errorCode, errorDescription) in
                 if errorCode == 0 {
                 if errorCode == 0 {
                     // Change DB
                     // Change DB
                     metadata.favorite = favorite
                     metadata.favorite = favorite

+ 1 - 2
File Provider Extension/FileProviderExtension+Thumbnail.swift

@@ -44,9 +44,8 @@ extension FileProviderExtension {
                 
                 
                 let fileNamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, activeUrl: fileProviderData.sharedInstance.accountUrl)!
                 let fileNamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, activeUrl: fileProviderData.sharedInstance.accountUrl)!
                 let fileNameLocalPath = CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, fileNameView: metadata.fileNameView)!
                 let fileNameLocalPath = CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, fileNameView: metadata.fileNameView)!
-                let serverUrl = fileProviderData.sharedInstance.accountUrl
                     
                     
-                NCCommunication.shared.downloadPreview(serverUrl: serverUrl, fileNamePath: fileNamePath, fileNameLocalPath: fileNameLocalPath ,width: Int(k_sizePreview), height: Int(k_sizePreview), customUserAgent: nil, addCustomHeaders: nil, account: fileProviderData.sharedInstance.account) { (account, data, errorCode, errorDescription) in
+                NCCommunication.shared.downloadPreview(fileNamePath: fileNamePath, fileNameLocalPath: fileNameLocalPath ,width: Int(k_sizePreview), height: Int(k_sizePreview), customUserAgent: nil, addCustomHeaders: nil, account: fileProviderData.sharedInstance.account) { (account, data, errorCode, errorDescription) in
                     if errorCode == 0 && data != nil {
                     if errorCode == 0 && data != nil {
                         perThumbnailCompletionHandler(itemIdentifier, data, nil)
                         perThumbnailCompletionHandler(itemIdentifier, data, nil)
                     } else {
                     } else {

+ 2 - 2
iOSClient/Activity/NCActivity.swift

@@ -236,7 +236,7 @@ extension NCActivity: UITableViewDataSource {
                     }
                     }
                 } else {
                 } else {
                     DispatchQueue.global().async {
                     DispatchQueue.global().async {
-                        NCCommunication.shared.downloadAvatar(serverUrl: self.appDelegate.activeUrl, userID: activity.user, fileNameLocalPath: fileNameLocalPath, size: Int(k_avatar_size), customUserAgent: nil, addCustomHeaders: nil, account: self.appDelegate.activeAccount) { (account, data, errorCode, errorMessage) in
+                        NCCommunication.shared.downloadAvatar(userID: activity.user, fileNameLocalPath: fileNameLocalPath, size: Int(k_avatar_size), customUserAgent: nil, addCustomHeaders: nil, account: self.appDelegate.activeAccount) { (account, data, errorCode, errorMessage) in
                             if errorCode == 0 && account == self.appDelegate.activeAccount && UIImage(data: data!) != nil {
                             if errorCode == 0 && account == self.appDelegate.activeAccount && UIImage(data: data!) != nil {
                                 cell.avatar.image = UIImage(data: data!)
                                 cell.avatar.image = UIImage(data: data!)
                             }
                             }
@@ -576,7 +576,7 @@ extension NCActivity {
             NCUtility.sharedInstance.startActivityIndicator(view: self.view, bottom: 50)
             NCUtility.sharedInstance.startActivityIndicator(view: self.view, bottom: 50)
         }
         }
         
         
-        NCCommunication.shared.getActivity(serverUrl: appDelegate.activeUrl, since: idActivity, limit: 200, objectId: filterFileId, objectType: objectType, previews: true, customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, activities, errorCode, errorDescription) in
+        NCCommunication.shared.getActivity(since: idActivity, limit: 200, objectId: filterFileId, objectType: objectType, previews: true, customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, activities, errorCode, errorDescription) in
             
             
            if errorCode == 0 && account == self.appDelegate.activeAccount {
            if errorCode == 0 && account == self.appDelegate.activeAccount {
                 NCManageDatabase.sharedInstance.addActivity(activities , account: account)
                 NCManageDatabase.sharedInstance.addActivity(activities , account: account)

+ 1 - 2
iOSClient/AppDelegate.m

@@ -103,8 +103,7 @@
     // Display notification
     // Display notification
     [UNUserNotificationCenter currentNotificationCenter].delegate = self;
     [UNUserNotificationCenter currentNotificationCenter].delegate = self;
     UNAuthorizationOptions authOptions = UNAuthorizationOptionAlert | UNAuthorizationOptionSound | UNAuthorizationOptionBadge;
     UNAuthorizationOptions authOptions = UNAuthorizationOptionAlert | UNAuthorizationOptionSound | UNAuthorizationOptionBadge;
-    [[UNUserNotificationCenter currentNotificationCenter] requestAuthorizationWithOptions:authOptions completionHandler:^(BOOL granted, NSError * _Nullable error) {
-    }];
+    [[UNUserNotificationCenter currentNotificationCenter] requestAuthorizationWithOptions:authOptions completionHandler:^(BOOL granted, NSError * _Nullable error) { }];
     
     
     //AV Session
     //AV Session
     [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error:nil];
     [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error:nil];

+ 2 - 2
iOSClient/Favorites/CCFavorites.m

@@ -201,8 +201,8 @@
     // test
     // test
     if (appDelegate.activeAccount.length == 0)
     if (appDelegate.activeAccount.length == 0)
         return;
         return;
-    
-    [[NCCommunication shared] listingFavoritesWithServerUrl:appDelegate.activeUrl showHiddenFiles:[CCUtility getShowHiddenFiles] customUserAgent:nil addCustomHeaders:nil account:appDelegate.activeAccount completionHandler:^(NSString *account, NSArray *files, NSInteger errorCode, NSString *errorMessage) {
+
+    [[NCCommunication shared] listingFavoritesWithShowHiddenFiles:[CCUtility getShowHiddenFiles] customUserAgent:nil addCustomHeaders:nil account:appDelegate.activeAccount completionHandler:^(NSString *account, NSArray *files, NSInteger errorCode, NSString *errorMessage) {
         
         
          if (errorCode == 0 && [account isEqualToString:appDelegate.activeAccount] && files != nil) {
          if (errorCode == 0 && [account isEqualToString:appDelegate.activeAccount] && files != nil) {
              
              

+ 4 - 4
iOSClient/Main/Create cloud/NCCreateFormUploadDocuments.swift

@@ -317,7 +317,7 @@ import NCCommunication
                 customUserAgent = NCUtility.sharedInstance.getCustomUserAgentOnlyOffice()
                 customUserAgent = NCUtility.sharedInstance.getCustomUserAgentOnlyOffice()
             }
             }
             
             
-            NCCommunication.shared.NCTextCreateFile(serverUrl: appDelegate.activeUrl, fileNamePath: fileNamePath, editorId: editorId, creatorId: creatorId, templateId: templateIdentifier, customUserAgent: customUserAgent, addCustomHeaders: nil, account: self.appDelegate.activeAccount) { (account, url, errorCode, errorMessage) in
+            NCCommunication.shared.NCTextCreateFile(fileNamePath: fileNamePath, editorId: editorId, creatorId: creatorId, templateId: templateIdentifier, customUserAgent: customUserAgent, addCustomHeaders: nil, account: self.appDelegate.activeAccount) { (account, url, errorCode, errorMessage) in
                 
                 
                 if errorCode == 0 && account == self.appDelegate.activeAccount {
                 if errorCode == 0 && account == self.appDelegate.activeAccount {
                     
                     
@@ -350,7 +350,7 @@ import NCCommunication
         
         
         if self.editorId == k_editor_collabora {
         if self.editorId == k_editor_collabora {
             
             
-            NCCommunication.shared.createRichdocuments(serverUrl: appDelegate.activeUrl, path: fileNamePath, templateID: templateIdentifier, customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, url, errorCode, errorDescription) in
+            NCCommunication.shared.createRichdocuments(path: fileNamePath, templateID: templateIdentifier, customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, url, errorCode, errorDescription) in
                 
                 
                 if errorCode == 0 && account == self.appDelegate.activeAccount && url != nil {
                 if errorCode == 0 && account == self.appDelegate.activeAccount && url != nil {
                    
                    
@@ -392,7 +392,7 @@ import NCCommunication
                 customUserAgent = NCUtility.sharedInstance.getCustomUserAgentOnlyOffice()
                 customUserAgent = NCUtility.sharedInstance.getCustomUserAgentOnlyOffice()
             }
             }
             
             
-            NCCommunication.shared.NCTextGetListOfTemplates(serverUrl: appDelegate.activeUrl, customUserAgent: customUserAgent, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, templates, errorCode, errorMessage) in
+            NCCommunication.shared.NCTextGetListOfTemplates(customUserAgent: customUserAgent, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, templates, errorCode, errorMessage) in
                 
                 
                 self.indicator.stopAnimating()
                 self.indicator.stopAnimating()
                 
                 
@@ -454,7 +454,7 @@ import NCCommunication
         
         
         if self.editorId == k_editor_collabora  {
         if self.editorId == k_editor_collabora  {
                         
                         
-            NCCommunication.shared.getTemplatesRichdocuments(serverUrl: appDelegate.activeUrl, typeTemplate: typeTemplate, customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, templates, errorCode, errorDescription) in
+            NCCommunication.shared.getTemplatesRichdocuments(typeTemplate: typeTemplate, customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, templates, errorCode, errorDescription) in
                 
                 
                 self.indicator.stopAnimating()
                 self.indicator.stopAnimating()
 
 

+ 3 - 3
iOSClient/Main/NCDetailViewController.swift

@@ -512,7 +512,7 @@ class NCDetailViewController: UIViewController {
                             self.navigationController?.navigationBar.topItem?.title = ""
                             self.navigationController?.navigationBar.topItem?.title = ""
                         }
                         }
                         
                         
-                        NCCommunication.shared.NCTextOpenFile(serverUrl: appDelegate.activeUrl, fileNamePath: fileNamePath, editor: editor, customUserAgent: customUserAgent, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, url, errorCode, errorMessage) in
+                        NCCommunication.shared.NCTextOpenFile(fileNamePath: fileNamePath, editor: editor, customUserAgent: customUserAgent, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, url, errorCode, errorMessage) in
                             
                             
                             if errorCode == 0 && account == self.appDelegate.activeAccount && url != nil {
                             if errorCode == 0 && account == self.appDelegate.activeAccount && url != nil {
                                 
                                 
@@ -553,7 +553,7 @@ class NCDetailViewController: UIViewController {
                 
                 
                 if metadata.url == "" {
                 if metadata.url == "" {
                     
                     
-                    NCCommunication.shared.createUrlRichdocuments(serverUrl: appDelegate.activeUrl, fileID: metadata.fileId, customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, url, errorCode, errorDescription) in
+                    NCCommunication.shared.createUrlRichdocuments(fileID: metadata.fileId, customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, url, errorCode, errorDescription) in
                         
                         
                         if errorCode == 0 && account == self.appDelegate.activeAccount && url != nil {
                         if errorCode == 0 && account == self.appDelegate.activeAccount && url != nil {
                             
                             
@@ -743,7 +743,7 @@ extension NCDetailViewController: NCViewerImageViewControllerDelegate, NCViewerI
             let fileNamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, activeUrl: appDelegate.activeUrl)!
             let fileNamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, activeUrl: appDelegate.activeUrl)!
             let fileNameLocalPath = CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, fileNameView: metadata.fileNameView)!
             let fileNameLocalPath = CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, fileNameView: metadata.fileNameView)!
                     
                     
-            NCCommunication.shared.downloadPreview(serverUrl: appDelegate.activeUrl, fileNamePath: fileNamePath, fileNameLocalPath: fileNameLocalPath, width: Int(k_sizePreview), height: Int(k_sizePreview), customUserAgent: nil, addCustomHeaders: nil, account: metadata.account) { (account, data, errorCode, errorMessage) in
+            NCCommunication.shared.downloadPreview(fileNamePath: fileNamePath, fileNameLocalPath: fileNameLocalPath, width: Int(k_sizePreview), height: Int(k_sizePreview), customUserAgent: nil, addCustomHeaders: nil, account: metadata.account) { (account, data, errorCode, errorMessage) in
                 if errorCode == 0 && data != nil {
                 if errorCode == 0 && data != nil {
                     completion(index, UIImage.init(data: data!), metadata, ZoomScale.default, nil)
                     completion(index, UIImage.init(data: data!), metadata, ZoomScale.default, nil)
                 } else {
                 } else {

+ 3 - 3
iOSClient/Main/NCMainCommon.swift

@@ -349,7 +349,7 @@ class NCMainCommon: NSObject, NCAudioRecorderViewControllerDelegate, UIDocumentI
                 } else if FileManager.default.fileExists(atPath: fileNameSource) {
                 } else if FileManager.default.fileExists(atPath: fileNameSource) {
                     cell.shared.image = NCUtility.sharedInstance.createAvatar(fileNameSource: fileNameSource, fileNameSourceAvatar: fileNameSourceAvatar)
                     cell.shared.image = NCUtility.sharedInstance.createAvatar(fileNameSource: fileNameSource, fileNameSourceAvatar: fileNameSourceAvatar)
                 } else {
                 } else {
-                    NCCommunication.shared.downloadAvatar(serverUrl: appDelegate.activeUrl, userID: metadata.ownerId, fileNameLocalPath: fileNameSource, size: Int(k_avatar_size), customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, data, errorCode, errorMessage) in
+                    NCCommunication.shared.downloadAvatar(userID: metadata.ownerId, fileNameLocalPath: fileNameSource, size: Int(k_avatar_size), customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, data, errorCode, errorMessage) in
                         if errorCode == 0 && account == self.appDelegate.activeAccount {
                         if errorCode == 0 && account == self.appDelegate.activeAccount {
                             cell.shared.image = NCUtility.sharedInstance.createAvatar(fileNameSource: fileNameSource, fileNameSourceAvatar: fileNameSourceAvatar)
                             cell.shared.image = NCUtility.sharedInstance.createAvatar(fileNameSource: fileNameSource, fileNameSourceAvatar: fileNameSourceAvatar)
                         }
                         }
@@ -613,7 +613,7 @@ class NCMainCommon: NSObject, NCAudioRecorderViewControllerDelegate, UIDocumentI
                             cell.shared.image = avatar
                             cell.shared.image = avatar
                         }
                         }
                     } else {
                     } else {
-                        NCCommunication.shared.downloadAvatar(serverUrl: appDelegate.activeUrl, userID: metadata.ownerId, fileNameLocalPath: fileNameSource, size: Int(k_avatar_size), customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, data, errorCode, errorMessage) in
+                        NCCommunication.shared.downloadAvatar(userID: metadata.ownerId, fileNameLocalPath: fileNameSource, size: Int(k_avatar_size), customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, data, errorCode, errorMessage) in
                             if errorCode == 0 && account == self.appDelegate.activeAccount {
                             if errorCode == 0 && account == self.appDelegate.activeAccount {
                                 cell.shared.image = NCUtility.sharedInstance.createAvatar(fileNameSource: fileNameSource, fileNameSourceAvatar: fileNameSourceAvatar)
                                 cell.shared.image = NCUtility.sharedInstance.createAvatar(fileNameSource: fileNameSource, fileNameSourceAvatar: fileNameSourceAvatar)
                             }
                             }
@@ -1070,7 +1070,7 @@ class NCNetworkingMain: NSObject, IMImagemeterViewerDelegate {
             let fileNamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, activeUrl: appDelegate.activeUrl)!
             let fileNamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, activeUrl: appDelegate.activeUrl)!
             let fileNameLocalPath = CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, fileNameView: metadata.fileNameView)!
             let fileNameLocalPath = CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, fileNameView: metadata.fileNameView)!
                     
                     
-            NCCommunication.shared.downloadPreview(serverUrl: appDelegate.activeUrl, fileNamePath: fileNamePath, fileNameLocalPath: fileNameLocalPath, width: Int(k_sizePreview), height: Int(k_sizePreview), customUserAgent: nil, addCustomHeaders: nil, account: metadata.account) { (account, data, errorCode, errorMessage) in
+            NCCommunication.shared.downloadPreview(fileNamePath: fileNamePath, fileNameLocalPath: fileNameLocalPath, width: Int(k_sizePreview), height: Int(k_sizePreview), customUserAgent: nil, addCustomHeaders: nil, account: metadata.account) { (account, data, errorCode, errorMessage) in
                 
                 
                 if errorCode == 0 && data != nil  {
                 if errorCode == 0 && data != nil  {
                     if let image = UIImage.init(data: data!) {
                     if let image = UIImage.init(data: data!) {

+ 1 - 1
iOSClient/Media/NCMedia.swift

@@ -627,7 +627,7 @@ extension NCMedia {
         }
         }
         loadingSearch = true
         loadingSearch = true
         
         
-        NCCommunication.shared.searchMedia(serverUrl: appDelegate.activeUrl, lteDateLastModified: lteDate, gteDateLastModified: gteDate, showHiddenFiles: CCUtility.getShowHiddenFiles(), customUserAgent: nil, addCustomHeaders: nil, user: appDelegate.activeUser, account: appDelegate.activeAccount) { (account, files, errorCode, errorDescription) in
+        NCCommunication.shared.searchMedia(lteDateLastModified: lteDate, gteDateLastModified: gteDate, showHiddenFiles: CCUtility.getShowHiddenFiles(), customUserAgent: nil, addCustomHeaders: nil, user: appDelegate.activeUser, account: appDelegate.activeAccount) { (account, files, errorCode, errorDescription) in
             
             
             self.refreshControl.endRefreshing()
             self.refreshControl.endRefreshing()
             NCUtility.sharedInstance.stopActivityIndicator()
             NCUtility.sharedInstance.stopActivityIndicator()

+ 1 - 1
iOSClient/Networking/NCNetworking.swift

@@ -382,7 +382,7 @@ import NCCommunication
         let fileName = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, activeUrl: url)!
         let fileName = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, activeUrl: url)!
         let favorite = !metadata.favorite
         let favorite = !metadata.favorite
         
         
-        NCCommunication.shared.setFavorite(serverUrl: url, fileName: fileName, favorite: favorite, customUserAgent: nil, addCustomHeaders: nil, account: metadata.account) { (account, errorCode, errorDescription) in
+        NCCommunication.shared.setFavorite(fileName: fileName, favorite: favorite, customUserAgent: nil, addCustomHeaders: nil, account: metadata.account) { (account, errorCode, errorDescription) in
     
     
             if errorCode == 0 && metadata.account == account {
             if errorCode == 0 && metadata.account == account {
                 NCManageDatabase.sharedInstance.setMetadataFavorite(ocId: metadata.ocId, favorite: favorite)
                 NCManageDatabase.sharedInstance.setMetadataFavorite(ocId: metadata.ocId, favorite: favorite)

+ 4 - 4
iOSClient/Networking/NCService.swift

@@ -53,7 +53,7 @@ class NCService: NSObject {
             return
             return
         }
         }
         
         
-        NCCommunication.shared.getUserProfile(serverUrl: appDelegate.activeUrl, customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, userProfile, errorCode, errorDescription) in
+        NCCommunication.shared.getUserProfile(customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, userProfile, errorCode, errorDescription) in
                  
                  
             if errorCode == 0 && account == self.appDelegate.activeAccount {
             if errorCode == 0 && account == self.appDelegate.activeAccount {
                 
                 
@@ -129,7 +129,7 @@ class NCService: NSObject {
             return
             return
         }
         }
         
         
-        NCCommunication.shared.getCapabilities(serverUrl: appDelegate.activeUrl, customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, data, errorCode, errorDescription) in
+        NCCommunication.shared.getCapabilities(customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, data, errorCode, errorDescription) in
             
             
             if errorCode == 0 && data != nil {
             if errorCode == 0 && data != nil {
                 NCManageDatabase.sharedInstance.addCapabilitiesJSon(data!, account: account)
                 NCManageDatabase.sharedInstance.addCapabilitiesJSon(data!, account: account)
@@ -160,7 +160,7 @@ class NCService: NSObject {
                 // NCTextObtainEditorDetails
                 // NCTextObtainEditorDetails
                 let serverVersionMajor = NCManageDatabase.sharedInstance.getCapabilitiesServerInt(account: account, elements: NCElementsJSON.shared.capabilitiesVersionMajor)
                 let serverVersionMajor = NCManageDatabase.sharedInstance.getCapabilitiesServerInt(account: account, elements: NCElementsJSON.shared.capabilitiesVersionMajor)
                 if serverVersionMajor >= k_nextcloud_version_18_0 {
                 if serverVersionMajor >= k_nextcloud_version_18_0 {
-                    NCCommunication.shared.NCTextObtainEditorDetails(serverUrl: self.appDelegate.activeUrl, customUserAgent: nil, addCustomHeaders: nil, account: self.appDelegate.activeAccount) { (account, editors, creators, errorCode, errorMessage) in
+                    NCCommunication.shared.NCTextObtainEditorDetails(customUserAgent: nil, addCustomHeaders: nil, account: self.appDelegate.activeAccount) { (account, editors, creators, errorCode, errorMessage) in
                         if errorCode == 0 && account == self.appDelegate.activeAccount {
                         if errorCode == 0 && account == self.appDelegate.activeAccount {
                             NCManageDatabase.sharedInstance.addDirectEditing(account: account, editors: editors, creators: creators)
                             NCManageDatabase.sharedInstance.addDirectEditing(account: account, editors: editors, creators: creators)
                         }
                         }
@@ -169,7 +169,7 @@ class NCService: NSObject {
                 
                 
                 let isExternalSitesServerEnabled = NCManageDatabase.sharedInstance.getCapabilitiesServerBool(account: account, elements: NCElementsJSON.shared.capabilitiesExternalSitesExists, exists: true)
                 let isExternalSitesServerEnabled = NCManageDatabase.sharedInstance.getCapabilitiesServerBool(account: account, elements: NCElementsJSON.shared.capabilitiesExternalSitesExists, exists: true)
                 if (isExternalSitesServerEnabled) {
                 if (isExternalSitesServerEnabled) {
-                    NCCommunication.shared.getExternalSite(serverUrl: self.appDelegate.activeUrl, customUserAgent: nil, addCustomHeaders: nil, account: account) { (account, externalSites, errorCode, errorDescription) in
+                    NCCommunication.shared.getExternalSite(customUserAgent: nil, addCustomHeaders: nil, account: account) { (account, externalSites, errorCode, errorDescription) in
                         if errorCode == 0 && account == self.appDelegate.activeAccount {
                         if errorCode == 0 && account == self.appDelegate.activeAccount {
                             NCManageDatabase.sharedInstance.deleteExternalSites(account: account)
                             NCManageDatabase.sharedInstance.deleteExternalSites(account: account)
                             for externalSite in externalSites {
                             for externalSite in externalSites {

+ 1 - 1
iOSClient/Notification/CCNotification.swift

@@ -132,7 +132,7 @@ class CCNotification: UITableViewController, CCNotificationCelllDelegate, DZNEmp
                         }
                         }
                     } else {
                     } else {
                         DispatchQueue.global().async {
                         DispatchQueue.global().async {
-                            NCCommunication.shared.downloadAvatar(serverUrl: self.appDelegate.activeUrl, userID: name, fileNameLocalPath: fileNameLocalPath, size: Int(k_avatar_size), customUserAgent: nil, addCustomHeaders: nil, account: self.appDelegate.activeAccount) { (account, data, errorCode, errorMessage) in
+                            NCCommunication.shared.downloadAvatar(userID: name, fileNameLocalPath: fileNameLocalPath, size: Int(k_avatar_size), customUserAgent: nil, addCustomHeaders: nil, account: self.appDelegate.activeAccount) { (account, data, errorCode, errorMessage) in
                                 if errorCode == 0 && account == self.appDelegate.activeAccount && UIImage(data: data!) != nil {
                                 if errorCode == 0 && account == self.appDelegate.activeAccount && UIImage(data: data!) != nil {
                                     if let image = UIImage(contentsOfFile: fileNameLocalPath) {
                                     if let image = UIImage(contentsOfFile: fileNameLocalPath) {
                                         cell.avatar.isHidden = false
                                         cell.avatar.isHidden = false

+ 1 - 1
iOSClient/PeekPop/CCPeekPop.m

@@ -104,7 +104,7 @@
     NSString *fileNamePath = [CCUtility returnFileNamePathFromFileName:self.metadata.fileName serverUrl:self.metadata.serverUrl activeUrl:appDelegate.activeUrl];
     NSString *fileNamePath = [CCUtility returnFileNamePathFromFileName:self.metadata.fileName serverUrl:self.metadata.serverUrl activeUrl:appDelegate.activeUrl];
     NSString *fileNameLocalPath = [CCUtility getDirectoryProviderStorageOcId:self.metadata.ocId fileNameView:self.metadata.fileNameView];
     NSString *fileNameLocalPath = [CCUtility getDirectoryProviderStorageOcId:self.metadata.ocId fileNameView:self.metadata.fileNameView];
     
     
-    [[NCCommunication shared] downloadPreviewWithServerUrl:appDelegate.activeUrl fileNamePath:fileNamePath fileNameLocalPath:fileNameLocalPath width:k_sizePreview height:k_sizePreview customUserAgent:nil addCustomHeaders:nil account:self.metadata.account completionHandler:^(NSString *account, NSData *data, NSInteger errorCode, NSString *errorDescription) {
+    [[NCCommunication shared] downloadPreviewWithFileNamePath:fileNamePath fileNameLocalPath:fileNameLocalPath width:k_sizePreview height:k_sizePreview customUserAgent:nil addCustomHeaders:nil account:self.metadata.account completionHandler:^(NSString *account, NSData *data, NSInteger errorCode, NSString *errorDescription) {
 
 
         if (errorCode == 0) {
         if (errorCode == 0) {
             UIImage *image = [UIImage imageWithData:data];
             UIImage *image = [UIImage imageWithData:data];

+ 2 - 2
iOSClient/RichWorkspace/NCRichWorkspaceCommon.swift

@@ -40,7 +40,7 @@ import NCCommunication
         NCUtility.sharedInstance.startActivityIndicator(view: viewController.view, bottom: 0)
         NCUtility.sharedInstance.startActivityIndicator(view: viewController.view, bottom: 0)
         
         
         let fileNamePath = CCUtility.returnFileNamePath(fromFileName: k_fileNameRichWorkspace, serverUrl: serverUrl, activeUrl: appDelegate.activeUrl)!
         let fileNamePath = CCUtility.returnFileNamePath(fromFileName: k_fileNameRichWorkspace, serverUrl: serverUrl, activeUrl: appDelegate.activeUrl)!
-        NCCommunication.shared.NCTextCreateFile(serverUrl: appDelegate.activeUrl, fileNamePath: fileNamePath, editorId: directEditingCreator.editor, creatorId: directEditingCreator.identifier ,templateId: "", customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, url, errorCode, errorMessage) in
+        NCCommunication.shared.NCTextCreateFile(fileNamePath: fileNamePath, editorId: directEditingCreator.editor, creatorId: directEditingCreator.identifier ,templateId: "", customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, url, errorCode, errorMessage) in
             
             
             NCUtility.sharedInstance.stopActivityIndicator()
             NCUtility.sharedInstance.stopActivityIndicator()
             
             
@@ -75,7 +75,7 @@ import NCCommunication
                 NCUtility.sharedInstance.startActivityIndicator(view: viewController.view, bottom: 0)
                 NCUtility.sharedInstance.startActivityIndicator(view: viewController.view, bottom: 0)
                 
                 
                 let fileNamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, activeUrl: appDelegate.activeUrl)!
                 let fileNamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, activeUrl: appDelegate.activeUrl)!
-                NCCommunication.shared.NCTextOpenFile(serverUrl: appDelegate.activeUrl, fileNamePath: fileNamePath, editor: "text", customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, url, errorCode, errorMessage) in
+                NCCommunication.shared.NCTextOpenFile(fileNamePath: fileNamePath, editor: "text", customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, url, errorCode, errorMessage) in
                     
                     
                     NCUtility.sharedInstance.stopActivityIndicator()
                     NCUtility.sharedInstance.stopActivityIndicator()
                     
                     

+ 3 - 3
iOSClient/Share/NCShare.swift

@@ -82,7 +82,7 @@ class NCShare: UIViewController, UIGestureRecognizerDelegate, NCShareLinkCellDel
             if FileManager.default.fileExists(atPath: fileNameLocalPath) {
             if FileManager.default.fileExists(atPath: fileNameLocalPath) {
                 if let image = UIImage(contentsOfFile: fileNameLocalPath) { sharedWithYouByImage.image = image }
                 if let image = UIImage(contentsOfFile: fileNameLocalPath) { sharedWithYouByImage.image = image }
             } else {
             } else {
-                NCCommunication.shared.downloadAvatar(serverUrl: appDelegate.activeUrl, userID: metadata!.ownerId, fileNameLocalPath: fileNameLocalPath, size: Int(k_avatar_size), customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, data, errorCode, errorMessage) in
+                NCCommunication.shared.downloadAvatar(userID: metadata!.ownerId, fileNameLocalPath: fileNameLocalPath, size: Int(k_avatar_size), customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, data, errorCode, errorMessage) in
                     if errorCode == 0 && account == self.appDelegate.activeAccount && UIImage(data: data!) != nil {
                     if errorCode == 0 && account == self.appDelegate.activeAccount && UIImage(data: data!) != nil {
                         if let image = UIImage(contentsOfFile: fileNameLocalPath) {
                         if let image = UIImage(contentsOfFile: fileNameLocalPath) {
                             self.sharedWithYouByImage.image = image
                             self.sharedWithYouByImage.image = image
@@ -283,7 +283,7 @@ class NCShare: UIViewController, UIGestureRecognizerDelegate, NCShareLinkCellDel
                 if let image = UIImage(contentsOfFile: fileNameLocalPath) { cell.imageItem.image = image }
                 if let image = UIImage(contentsOfFile: fileNameLocalPath) { cell.imageItem.image = image }
             } else {
             } else {
                 DispatchQueue.global().async {
                 DispatchQueue.global().async {
-                    NCCommunication.shared.downloadAvatar(serverUrl: self.appDelegate.activeUrl, userID: item.name, fileNameLocalPath: fileNameLocalPath, size: Int(k_avatar_size), customUserAgent: nil, addCustomHeaders: nil, account: self.appDelegate.activeAccount) { (account, data, errorCode, errorMessage) in
+                    NCCommunication.shared.downloadAvatar(userID: item.name, fileNameLocalPath: fileNameLocalPath, size: Int(k_avatar_size), customUserAgent: nil, addCustomHeaders: nil, account: self.appDelegate.activeAccount) { (account, data, errorCode, errorMessage) in
                         if errorCode == 0 && account == self.appDelegate.activeAccount && UIImage(data: data!) != nil {
                         if errorCode == 0 && account == self.appDelegate.activeAccount && UIImage(data: data!) != nil {
                             if let image = UIImage(contentsOfFile: fileNameLocalPath) {
                             if let image = UIImage(contentsOfFile: fileNameLocalPath) {
                                 cell.imageItem.image = image
                                 cell.imageItem.image = image
@@ -375,7 +375,7 @@ extension NCShare: UITableViewDataSource {
                     if let image = UIImage(contentsOfFile: fileNameLocalPath) { cell.imageItem.image = image }
                     if let image = UIImage(contentsOfFile: fileNameLocalPath) { cell.imageItem.image = image }
                 } else {
                 } else {
                     DispatchQueue.global().async {
                     DispatchQueue.global().async {
-                        NCCommunication.shared.downloadAvatar(serverUrl: self.appDelegate.activeUrl, userID: tableShare.shareWith, fileNameLocalPath: fileNameLocalPath, size: Int(k_avatar_size), customUserAgent: nil, addCustomHeaders: nil, account: self.appDelegate.activeAccount) { (account, data, errorCode, errorMessage) in
+                        NCCommunication.shared.downloadAvatar(userID: tableShare.shareWith, fileNameLocalPath: fileNameLocalPath, size: Int(k_avatar_size), customUserAgent: nil, addCustomHeaders: nil, account: self.appDelegate.activeAccount) { (account, data, errorCode, errorMessage) in
                             if errorCode == 0 && account == self.appDelegate.activeAccount && UIImage(data: data!) != nil {
                             if errorCode == 0 && account == self.appDelegate.activeAccount && UIImage(data: data!) != nil {
                                 if let image = UIImage(contentsOfFile: fileNameLocalPath) {
                                 if let image = UIImage(contentsOfFile: fileNameLocalPath) {
                                     cell.imageItem.image = image
                                     cell.imageItem.image = image

+ 1 - 1
iOSClient/Share/NCShareComments.swift

@@ -253,7 +253,7 @@ extension NCShareComments: UITableViewDataSource {
                 if let image = UIImage(contentsOfFile: fileNameLocalPath) { cell.imageItem.image = image }
                 if let image = UIImage(contentsOfFile: fileNameLocalPath) { cell.imageItem.image = image }
             } else {
             } else {
                 DispatchQueue.global().async {
                 DispatchQueue.global().async {
-                    NCCommunication.shared.downloadAvatar(serverUrl: self.appDelegate.activeUrl, userID: tableComments.actorId, fileNameLocalPath: fileNameLocalPath, size: 128, customUserAgent: nil, addCustomHeaders: nil, account: self.appDelegate.activeAccount) { (account, data, errorCode, errorMessage) in
+                    NCCommunication.shared.downloadAvatar(userID: tableComments.actorId, fileNameLocalPath: fileNameLocalPath, size: 128, customUserAgent: nil, addCustomHeaders: nil, account: self.appDelegate.activeAccount) { (account, data, errorCode, errorMessage) in
                         if errorCode == 0 && UIImage(data: data!) != nil {
                         if errorCode == 0 && UIImage(data: data!) != nil {
                             cell.imageItem.image = UIImage(named: "avatar")
                             cell.imageItem.image = UIImage(named: "avatar")
                         }
                         }

+ 5 - 1
iOSClient/Trash/NCTrash.swift

@@ -661,6 +661,10 @@ extension NCTrash {
     
     
     @objc func loadListingTrash() {
     @objc func loadListingTrash() {
         
         
+        NCCommunication.shared.listingTrash(showHiddenFiles: false, customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (accountg, files, errorCode, errorDescription) in
+         
+        }
+        
         OCNetworking.sharedManager().listingTrash(withAccount: appDelegate.activeAccount, path: path, serverUrl: appDelegate.activeUrl, depth: "1", completion: { (account, item, message, errorCode) in
         OCNetworking.sharedManager().listingTrash(withAccount: appDelegate.activeAccount, path: path, serverUrl: appDelegate.activeUrl, depth: "1", completion: { (account, item, message, errorCode) in
             
             
             self.refreshControl.endRefreshing()
             self.refreshControl.endRefreshing()
@@ -744,7 +748,7 @@ extension NCTrash {
         
         
         let fileNameLocalPath = CCUtility.getDirectoryProviderStorageIconOcId(tableTrash.fileId, fileNameView: tableTrash.fileName)!
         let fileNameLocalPath = CCUtility.getDirectoryProviderStorageIconOcId(tableTrash.fileId, fileNameView: tableTrash.fileName)!
         
         
-        NCCommunication.shared.downloadPreviewTrash(serverUrl: appDelegate.activeUrl, fileId: tableTrash.fileId, fileNameLocalPath: fileNameLocalPath, width: Int(k_sizePreview), height: Int(k_sizePreview), customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, data, errorCode, errorDescription) in
+        NCCommunication.shared.downloadPreviewTrash(fileId: tableTrash.fileId, fileNameLocalPath: fileNameLocalPath, width: Int(k_sizePreview), height: Int(k_sizePreview), customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, data, errorCode, errorDescription) in
             
             
             if errorCode == 0 && data != nil && account == self.appDelegate.activeAccount {
             if errorCode == 0 && data != nil && account == self.appDelegate.activeAccount {
                 if let cell = self.collectionView.cellForItem(at: indexPath), let image = UIImage.init(data: data!) {
                 if let cell = self.collectionView.cellForItem(at: indexPath), let image = UIImage.init(data: data!) {

+ 2 - 2
iOSClient/Viewer/NCViewerRichdocument.swift

@@ -210,7 +210,7 @@ class NCViewerRichdocument: WKWebView, WKNavigationDelegate, WKScriptMessageHand
             
             
             let path = CCUtility.returnFileNamePath(fromFileName: metadata!.fileName, serverUrl: serverUrl!, activeUrl: appDelegate.activeUrl)!
             let path = CCUtility.returnFileNamePath(fromFileName: metadata!.fileName, serverUrl: serverUrl!, activeUrl: appDelegate.activeUrl)!
             
             
-            NCCommunication.shared.createAssetRichdocuments(serverUrl: appDelegate.activeUrl, path: path, customUserAgent: nil, addCustomHeaders: nil, account: metadata!.account) { (account, url, errorCode, errorDescription) in
+            NCCommunication.shared.createAssetRichdocuments(path: path, customUserAgent: nil, addCustomHeaders: nil, account: metadata!.account) { (account, url, errorCode, errorDescription) in
                 if errorCode == 0 && account == self.appDelegate.activeAccount {
                 if errorCode == 0 && account == self.appDelegate.activeAccount {
                     let functionJS = "OCA.RichDocuments.documentsMain.postAsset('\(metadata!.fileNameView)', '\(url!)')"
                     let functionJS = "OCA.RichDocuments.documentsMain.postAsset('\(metadata!.fileNameView)', '\(url!)')"
                     self.evaluateJavaScript(functionJS, completionHandler: { (result, error) in })
                     self.evaluateJavaScript(functionJS, completionHandler: { (result, error) in })
@@ -227,7 +227,7 @@ class NCViewerRichdocument: WKWebView, WKNavigationDelegate, WKScriptMessageHand
         
         
         let path = CCUtility.returnFileNamePath(fromFileName: metadata!.fileName, serverUrl: serverUrl!, activeUrl: appDelegate.activeUrl)!
         let path = CCUtility.returnFileNamePath(fromFileName: metadata!.fileName, serverUrl: serverUrl!, activeUrl: appDelegate.activeUrl)!
         
         
-        NCCommunication.shared.createAssetRichdocuments(serverUrl: appDelegate.activeUrl, path: path, customUserAgent: nil, addCustomHeaders: nil, account: metadata!.account) { (account, url, errorCode, errorDescription) in
+        NCCommunication.shared.createAssetRichdocuments(path: path, customUserAgent: nil, addCustomHeaders: nil, account: metadata!.account) { (account, url, errorCode, errorDescription) in
             if errorCode == 0 && account == self.appDelegate.activeAccount {
             if errorCode == 0 && account == self.appDelegate.activeAccount {
                 let functionJS = "OCA.RichDocuments.documentsMain.postAsset('\(metadata.fileNameView)', '\(url!)')"
                 let functionJS = "OCA.RichDocuments.documentsMain.postAsset('\(metadata.fileNameView)', '\(url!)')"
                 self.evaluateJavaScript(functionJS, completionHandler: { (result, error) in })
                 self.evaluateJavaScript(functionJS, completionHandler: { (result, error) in })