marinofaggiana 4 yıl önce
ebeveyn
işleme
d8ad43cdd4
35 değiştirilmiş dosya ile 93 ekleme ve 168 silme
  1. 3 3
      File Provider Extension/FileProviderData.swift
  2. 3 3
      File Provider Extension/FileProviderEnumerator.swift
  3. 5 5
      File Provider Extension/FileProviderExtension+Actions.swift
  4. 1 1
      File Provider Extension/FileProviderExtension+Thumbnail.swift
  5. 1 1
      File Provider Extension/FileProviderExtension.swift
  6. 1 1
      Share/NCSelectDestination.m
  7. 2 2
      Share/ShareViewController.m
  8. 5 5
      iOSClient/Activity/NCActivity.swift
  9. 1 1
      iOSClient/AppDelegate.m
  10. 1 1
      iOSClient/CCGlobal.h
  11. 2 2
      iOSClient/Database/NCDatabase.swift
  12. 5 1
      iOSClient/Database/NCManageDatabase.swift
  13. 1 1
      iOSClient/Favorites/CCFavorites.m
  14. 1 1
      iOSClient/Login/CCLogin.m
  15. 1 1
      iOSClient/Login/NCLoginWeb.swift
  16. 1 1
      iOSClient/Main/CCMain.m
  17. 5 5
      iOSClient/Main/Create cloud/NCCreateFormUploadDocuments.swift
  18. 5 5
      iOSClient/Main/NCDetailViewController.swift
  19. 3 3
      iOSClient/Main/NCMainCommon.swift
  20. 1 1
      iOSClient/Media/NCMedia.swift
  21. 8 8
      iOSClient/Networking/NCNetworking.swift
  22. 2 2
      iOSClient/Networking/NCNetworkingCheckRemoteUser.swift
  23. 1 1
      iOSClient/Networking/NCNetworkingE2EE.swift
  24. 6 6
      iOSClient/Networking/NCService.swift
  25. 0 2
      iOSClient/Networking/OCNetworking.h
  26. 0 76
      iOSClient/Networking/OCNetworking.m
  27. 3 3
      iOSClient/Notification/NCNotification.swift
  28. 1 1
      iOSClient/PeekPop/CCPeekPop.m
  29. 2 2
      iOSClient/RichWorkspace/NCRichWorkspaceCommon.swift
  30. 3 3
      iOSClient/Share/NCShare.swift
  31. 9 9
      iOSClient/Share/NCShareComments.swift
  32. 1 1
      iOSClient/Synchronize/CCSynchronize.m
  33. 5 5
      iOSClient/Trash/NCTrash.swift
  34. 1 1
      iOSClient/Utility/NCUtility.swift
  35. 3 4
      iOSClient/Viewer/NCViewerRichdocument.swift

+ 3 - 3
File Provider Extension/FileProviderData.swift

@@ -84,7 +84,7 @@ class fileProviderData: NSObject {
             accountUrl = tableAccount.url
             homeServerUrl = CCUtility.getHomeServerUrlActiveUrl(tableAccount.url)
                         
-            NCCommunicationCommon.shared.setup(user: accountUser, userId: accountUserID, password: accountPassword, url: accountUrl, userAgent: CCUtility.getUserAgent(), capabilitiesGroup: NCBrandOptions.sharedInstance.capabilitiesGroups, webDavRoot: webDavRoot, davRoot: nil, nextcloudVersion: serverVersionMajor, delegate: NCNetworking.sharedInstance)
+            NCCommunicationCommon.shared.setup(user: accountUser, userId: accountUserID, password: accountPassword, account: account, url: accountUrl, userAgent: CCUtility.getUserAgent(), capabilitiesGroup: NCBrandOptions.sharedInstance.capabilitiesGroups, webDavRoot: webDavRoot, davRoot: nil, nextcloudVersion: serverVersionMajor, delegate: NCNetworking.sharedInstance)
             NCNetworking.sharedInstance.delegate = providerExtension as? NCNetworkingDelegate
             
             return true
@@ -110,7 +110,7 @@ class fileProviderData: NSObject {
                 accountUrl = tableAccount.url
                 homeServerUrl = CCUtility.getHomeServerUrlActiveUrl(tableAccount.url)
                 
-                NCCommunicationCommon.shared.setup(user: accountUser, userId: accountUserID, password: accountPassword, url: accountUrl, userAgent: CCUtility.getUserAgent(), capabilitiesGroup: NCBrandOptions.sharedInstance.capabilitiesGroups, webDavRoot: webDavRoot, davRoot: nil, nextcloudVersion: serverVersionMajor, delegate: NCNetworking.sharedInstance)
+                NCCommunicationCommon.shared.setup(user: accountUser, userId: accountUserID, password: accountPassword, account: account, url: accountUrl, userAgent: CCUtility.getUserAgent(), capabilitiesGroup: NCBrandOptions.sharedInstance.capabilitiesGroups, webDavRoot: webDavRoot, davRoot: nil, nextcloudVersion: serverVersionMajor, delegate: NCNetworking.sharedInstance)
                 NCNetworking.sharedInstance.delegate = providerExtension as? NCNetworkingDelegate
 
                 foundAccount = true
@@ -142,7 +142,7 @@ class fileProviderData: NSObject {
                 accountUrl = tableAccount.url
                 homeServerUrl = CCUtility.getHomeServerUrlActiveUrl(tableAccount.url)
                 
-                NCCommunicationCommon.shared.setup(user: accountUser, userId: accountUserID, password: accountPassword, url: accountUrl, userAgent: CCUtility.getUserAgent(), capabilitiesGroup: NCBrandOptions.sharedInstance.capabilitiesGroups, webDavRoot: webDavRoot, davRoot: nil, nextcloudVersion: serverVersionMajor, delegate: NCNetworking.sharedInstance)
+                NCCommunicationCommon.shared.setup(user: accountUser, userId: accountUserID, password: accountPassword, account: account, url: accountUrl, userAgent: CCUtility.getUserAgent(), capabilitiesGroup: NCBrandOptions.sharedInstance.capabilitiesGroups, webDavRoot: webDavRoot, davRoot: nil, nextcloudVersion: serverVersionMajor, delegate: NCNetworking.sharedInstance)
                 NCNetworking.sharedInstance.delegate = providerExtension as? NCNetworkingDelegate
                 
                 foundAccount = true

+ 3 - 3
File Provider Extension/FileProviderEnumerator.swift

@@ -224,7 +224,7 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {
         
     func readFileOrFolder(serverUrl: String, completionHandler: @escaping () -> Void) {
         
-        NCCommunication.shared.readFileOrFolder(serverUrlFileName: serverUrl, depth: "0", showHiddenFiles: CCUtility.getShowHiddenFiles(), customUserAgent: nil, addCustomHeaders: nil, account: fileProviderData.sharedInstance.account, completionHandler: { (account, files, errorCode, errorDescription) in
+        NCCommunication.shared.readFileOrFolder(serverUrlFileName: serverUrl, depth: "0", showHiddenFiles: CCUtility.getShowHiddenFiles(), completionHandler: { (account, files, errorCode, errorDescription) in
             
             var needReadFolder = true
         
@@ -238,7 +238,7 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {
             
             if needReadFolder {
 
-                NCCommunication.shared.readFileOrFolder(serverUrlFileName: serverUrl, depth: "1", showHiddenFiles: CCUtility.getShowHiddenFiles(), customUserAgent: nil, addCustomHeaders: nil, account: fileProviderData.sharedInstance.account, completionHandler: { (account, files, errorCode, errorDescription) in
+                NCCommunication.shared.readFileOrFolder(serverUrlFileName: serverUrl, depth: "1", showHiddenFiles: CCUtility.getShowHiddenFiles(), completionHandler: { (account, files, errorCode, errorDescription) in
                     
                     if errorCode == 0 && files != nil {
                         
@@ -283,7 +283,7 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {
             fileNamePath = CCUtility.returnPathfromServerUrl(serverUrl, activeUrl: fileProviderData.sharedInstance.accountUrl)!
         }
         
-        NCCommunication.shared.iosHelper(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) { (account, files, errorCode, errorDescription) in
             
              if errorCode == 0 && files != nil  && files!.count >= 1 {
                                 

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

@@ -36,7 +36,7 @@ extension FileProviderExtension {
         let directoryName = NCUtility.sharedInstance.createFileName(directoryName, serverUrl: tableDirectory.serverUrl, account: fileProviderData.sharedInstance.account)
         let serverUrlFileName = tableDirectory.serverUrl + "/" + directoryName
         
-        NCCommunication.shared.createFolder(serverUrlFileName, customUserAgent: nil, addCustomHeaders: nil, account: fileProviderData.sharedInstance.account) { (account, ocId, date, errorCode, errorDescription) in
+        NCCommunication.shared.createFolder(serverUrlFileName) { (account, ocId, date, errorCode, errorDescription) in
                         
             if errorCode == 0 {
                 
@@ -84,7 +84,7 @@ extension FileProviderExtension {
         
         let serverUrlFileName = metadata.serverUrl + "/" + metadata.fileName
         
-        NCCommunication.shared.deleteFileOrFolder(serverUrlFileName, customUserAgent: nil, addCustomHeaders: nil, account: fileProviderData.sharedInstance.account) { (account, errorCode, errorDescription) in
+        NCCommunication.shared.deleteFileOrFolder(serverUrlFileName) { (account, errorCode, errorDescription) in
             
             if errorCode == 0 { //|| error == kOCErrorServerPathNotFound {
             
@@ -134,7 +134,7 @@ extension FileProviderExtension {
         let serverUrlTo = tableDirectoryTo.serverUrl
         let fileNameTo = serverUrlTo + "/" + itemFrom.filename
         
-        NCCommunication.shared.moveFileOrFolder(serverUrlFileNameSource: fileNameFrom, serverUrlFileNameDestination: fileNameTo, overwrite: false, customUserAgent: nil, addCustomHeaders: nil, account: fileProviderData.sharedInstance.account) { (account, errorCode, errorDescription) in
+        NCCommunication.shared.moveFileOrFolder(serverUrlFileNameSource: fileNameFrom, serverUrlFileNameDestination: fileNameTo, overwrite: false) { (account, errorCode, errorDescription) in
        
             if errorCode == 0 {
                 
@@ -175,7 +175,7 @@ extension FileProviderExtension {
         let fileNamePathFrom = metadata.serverUrl + "/" + fileNameFrom
         let fileNamePathTo = metadata.serverUrl + "/" + itemName
         
-        NCCommunication.shared.moveFileOrFolder(serverUrlFileNameSource: fileNamePathFrom, serverUrlFileNameDestination: fileNamePathTo, overwrite: false, customUserAgent: nil, addCustomHeaders: nil, account: fileProviderData.sharedInstance.account) { (account, errorCode, errorDescription) in
+        NCCommunication.shared.moveFileOrFolder(serverUrlFileNameSource: fileNamePathFrom, serverUrlFileNameDestination: fileNamePathTo, overwrite: false) { (account, errorCode, errorDescription) in
        
             if errorCode == 0 {
                 
@@ -240,7 +240,7 @@ extension FileProviderExtension {
         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)!
             
-            NCCommunication.shared.setFavorite(fileName: fileNamePath, favorite: favorite, customUserAgent: nil, addCustomHeaders: nil, account: fileProviderData.sharedInstance.account) { (account, errorCode, errorDescription) in
+            NCCommunication.shared.setFavorite(fileName: fileNamePath, favorite: favorite) { (account, errorCode, errorDescription) in
                 if errorCode == 0 {
                     // Change DB
                     metadata.favorite = favorite

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

@@ -45,7 +45,7 @@ extension FileProviderExtension {
                 let fileNamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, activeUrl: fileProviderData.sharedInstance.accountUrl)!
                 let fileNameLocalPath = CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, fileNameView: metadata.fileNameView)!
                     
-                NCCommunication.shared.downloadPreview(fileNamePathOrFileId: 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(fileNamePathOrFileId: fileNamePath, fileNameLocalPath: fileNameLocalPath ,width: Int(k_sizePreview), height: Int(k_sizePreview)) { (account, data, errorCode, errorDescription) in
                     if errorCode == 0 && data != nil {
                         perThumbnailCompletionHandler(itemIdentifier, data, nil)
                     } else {

+ 1 - 1
File Provider Extension/FileProviderExtension.swift

@@ -221,7 +221,7 @@ class FileProviderExtension: NSFileProviderExtension {
         let serverUrlFileName = metadata.serverUrl + "/" + metadata.fileName
         let fileNameLocalPath = CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileName)!
         
-        let task = NCCommunication.shared.download(serverUrlFileName: serverUrlFileName, fileNameLocalPath: fileNameLocalPath, customUserAgent: nil, addCustomHeaders: nil, account: fileProviderData.sharedInstance.account, progressHandler: { (progress) in }) { (account, etag, date, length, errorCode, errorDescription) in
+        let task = NCCommunication.shared.download(serverUrlFileName: serverUrlFileName, fileNameLocalPath: fileNameLocalPath, progressHandler: { (progress) in }) { (account, etag, date, length, errorCode, errorDescription) in
             
             self.outstandingSessionTasks.removeValue(forKey: url)
             

+ 1 - 1
Share/NCSelectDestination.m

@@ -188,7 +188,7 @@
 {
     NSString *serverUrlFileName = [NSString stringWithFormat:@"%@/%@", _serverUrl, fileNameFolder];
      
-    [[NCCommunication shared] createFolder:serverUrlFileName customUserAgent:nil addCustomHeaders:nil account:activeAccount completionHandler:^(NSString *account, NSString *ocID, NSDate *date, NSInteger errorCode, NSString *errorDecription) {
+    [[NCCommunication shared] createFolder:serverUrlFileName customUserAgent:nil addCustomHeaders:nil completionHandler:^(NSString *account, NSString *ocID, NSDate *date, NSInteger errorCode, NSString *errorDecription) {
         if (errorCode == 0) {
            [self readFolder];
         } else {

+ 2 - 2
Share/ShareViewController.m

@@ -65,7 +65,7 @@
         NSString *webDavRoot = [[NCManageDatabase sharedInstance] getCapabilitiesServerStringWithAccount:tableAccount.account elements:NCElementsJSON.shared.capabilitiesWebDavRoot];
         
         // Networking
-        [[NCCommunicationCommon shared] setupWithUser:tableAccount.user userId:tableAccount.userID password:[CCUtility getPassword:tableAccount.account] url:tableAccount.url userAgent:[CCUtility getUserAgent] capabilitiesGroup:[NCBrandOptions sharedInstance].capabilitiesGroups webDavRoot:webDavRoot davRoot:nil nextcloudVersion:serverVersionMajor delegate:[NCNetworking sharedInstance]];
+        [[NCCommunicationCommon shared] setupWithUser:tableAccount.user userId:tableAccount.userID password:[CCUtility getPassword:tableAccount.account] account:tableAccount.account url:tableAccount.url userAgent:[CCUtility getUserAgent] capabilitiesGroup:[NCBrandOptions sharedInstance].capabilitiesGroups webDavRoot:webDavRoot davRoot:nil nextcloudVersion:serverVersionMajor delegate:[NCNetworking sharedInstance]];
        
         _activeAccount = tableAccount.account;
         
@@ -271,7 +271,7 @@
         NSString *fileNameForUpload = [[NCUtility sharedInstance] createFileName:fileName serverUrl:self.serverUrl account:self.activeAccount];
         NSString *fileNameServer = [NSString stringWithFormat:@"%@/%@", self.serverUrl, fileNameForUpload];
         
-        (void)[[NCCommunication shared] uploadWithServerUrlFileName:fileNameServer fileNameLocalPath:fileNameLocal dateCreationFile:nil dateModificationFile:nil customUserAgent:nil addCustomHeaders:nil account:self.activeAccount progressHandler:^(NSProgress * progress) {
+        (void)[[NCCommunication shared] uploadWithServerUrlFileName:fileNameServer fileNameLocalPath:fileNameLocal dateCreationFile:nil dateModificationFile:nil customUserAgent:nil addCustomHeaders:nil progressHandler:^(NSProgress * progress) {
             [self.hud progress:progress.fractionCompleted];
         } completionHandler:^(NSString *account, NSString *ocId, NSString *etag, NSDate *date, int64_t size, NSInteger errorCode, NSString *errorDescription) {
             [self.hud hideHud];

+ 5 - 5
iOSClient/Activity/NCActivity.swift

@@ -211,7 +211,7 @@ extension NCActivity: UITableViewDataSource {
                     if let image = UIImage(contentsOfFile: fileNameLocalPath) { cell.icon.image = image }
                 } else {
                     DispatchQueue.global().async {
-                        NCCommunication.shared.downloadContent(serverUrl: activity.icon, customUserAgent: nil, addCustomHeaders: nil, account: self.appDelegate.activeAccount) { (account, data, errorCode, errorMessage) in
+                        NCCommunication.shared.downloadContent(serverUrl: activity.icon) { (account, data, errorCode, errorMessage) in
                             if errorCode == 0 {
                                 do {
                                     try data!.write(to: NSURL(fileURLWithPath: fileNameLocalPath) as URL, options: .atomic)
@@ -236,7 +236,7 @@ extension NCActivity: UITableViewDataSource {
                     }
                 } else {
                     DispatchQueue.global().async {
-                        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
+                        NCCommunication.shared.downloadAvatar(userID: activity.user, fileNameLocalPath: fileNameLocalPath, size: Int(k_avatar_size)) { (account, data, errorCode, errorMessage) in
                             if errorCode == 0 && account == self.appDelegate.activeAccount && UIImage(data: data!) != nil {
                                 cell.avatar.image = UIImage(data: data!)
                             }
@@ -394,7 +394,7 @@ extension activityTableViewCell: UICollectionViewDelegate {
             
             NCUtility.sharedInstance.startActivityIndicator(view: (appDelegate.window.rootViewController?.view)!, bottom: 0)
             
-            _ = NCCommunication.shared.download(serverUrlFileName: serverUrlFileName, fileNameLocalPath: fileNameLocalPath, customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount, progressHandler: { (progress) in
+            _ = NCCommunication.shared.download(serverUrlFileName: serverUrlFileName, fileNameLocalPath: fileNameLocalPath, progressHandler: { (progress) in
                 
             }) { (account, etag, date, lenght, errorCode, errorDescription) in
                 
@@ -495,7 +495,7 @@ extension activityTableViewCell: UICollectionViewDataSource {
                             
                         } else {
                             
-                            NCCommunication.shared.downloadPreview(fileNamePathOrFileId: activityPreview.source, fileNameLocalPath: fileNamePath ,width: 0, height: 0, customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount, useInternalEndpoint: false) { (account, data, errorCode, errorDescription) in
+                            NCCommunication.shared.downloadPreview(fileNamePathOrFileId: activityPreview.source, fileNameLocalPath: fileNamePath ,width: 0, height: 0, useInternalEndpoint: false) { (account, data, errorCode, errorDescription) in
                                 if errorCode == 0 && data != nil {
                                     cell.imageView.image = UIImage.init(data: data!)
                                 }
@@ -580,7 +580,7 @@ extension NCActivity {
             NCUtility.sharedInstance.startActivityIndicator(view: self.view, bottom: 50)
         }
         
-        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
+        NCCommunication.shared.getActivity(since: idActivity, limit: 200, objectId: filterFileId, objectType: objectType, previews: true) { (account, activities, errorCode, errorDescription) in
             
            if errorCode == 0 && account == self.appDelegate.activeAccount {
                 NCManageDatabase.sharedInstance.addActivity(activities , account: account)

+ 1 - 1
iOSClient/AppDelegate.m

@@ -434,7 +434,7 @@
 
     (void)[NCNetworkingNotificationCenter shared];
 
-    [[NCCommunicationCommon shared] setupWithUser:activeUser userId:activeUserID password:activePassword url:activeUrl];
+    [[NCCommunicationCommon shared] setupWithUser:activeUser userId:activeUserID password:activePassword account:activeAccount url:activeUrl];
     [self settingSetupCommunicationCapabilities:activeAccount];
 }
 

+ 1 - 1
iOSClient/CCGlobal.h

@@ -84,7 +84,7 @@
 
 // Database Realm
 #define k_databaseDefault                               @"nextcloud.realm"
-#define k_databaseSchemaVersion                         105
+#define k_databaseSchemaVersion                         107
 
 // Intro selector
 #define k_intro_login                                   0

+ 2 - 2
iOSClient/Database/NCDatabase.swift

@@ -171,14 +171,14 @@ class tableComments: Object {
     @objc dynamic var creationDateTime = NSDate()
     @objc dynamic var isUnread: Bool = false
     @objc dynamic var message = ""
-    @objc dynamic var messageID = ""
+    @objc dynamic var messageId = ""
     @objc dynamic var objectId = ""
     @objc dynamic var objectType = ""
     @objc dynamic var path = ""
     @objc dynamic var verb = ""
     
     override static func primaryKey() -> String {
-        return "messageID"
+        return "messageId"
     }
 }
 

+ 5 - 1
iOSClient/Database/NCManageDatabase.swift

@@ -132,6 +132,10 @@ class NCManageDatabase: NSObject {
                         migration.deleteData(forType: tableCapabilities.className())
                     }
                     
+                    if oldSchemaVersion < 107 {
+                        migration.deleteData(forType: tableComments.className())
+                    }
+                    
                 }, shouldCompactOnLaunch: { totalBytes, usedBytes in
                     
                     // totalBytes refers to the size of the file on disk in bytes (data + free space)
@@ -994,7 +998,7 @@ class NCManageDatabase: NSObject {
                     object.creationDateTime = comment.creationDateTime as NSDate
                     object.isUnread = comment.isUnread
                     object.message = comment.message
-                    object.messageID = comment.messageId
+                    object.messageId = comment.messageId
                     object.objectId = comment.objectId
                     object.objectType = comment.objectType
                     object.path = comment.path

+ 1 - 1
iOSClient/Favorites/CCFavorites.m

@@ -202,7 +202,7 @@
     if (appDelegate.activeAccount.length == 0)
         return;
 
-    [[NCCommunication shared] listingFavoritesWithShowHiddenFiles:[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 completionHandler:^(NSString *account, NSArray *files, NSInteger errorCode, NSString *errorMessage) {
         
          if (errorCode == 0 && [account isEqualToString:appDelegate.activeAccount] && files != nil) {
              

+ 1 - 1
iOSClient/Login/CCLogin.m

@@ -199,7 +199,7 @@
             self.login.enabled = YES;
             
             // Login Flow V2
-            [[NCCommunication shared] getLoginFlowV2WithServerUrl:self.baseUrl.text customUserAgent:nil addCustomHeaders:nil completionHandler:^(NSString *token, NSString *endpoint, NSString *login, NSInteger errorCode, NSString *errorDescription) {
+            [[NCCommunication shared] getLoginFlowV2WithServerUrl:self.baseUrl.text completionHandler:^(NSString *token, NSString *endpoint, NSString *login, NSInteger errorCode, NSString *errorDescription) {
                 
                 // Login Flow V2
                 if (errorCode == 0 && [[NCBrandOptions sharedInstance] use_loginflowv2] && token != nil && endpoint != nil && login != nil) {

+ 1 - 1
iOSClient/Login/NCLoginWeb.swift

@@ -195,7 +195,7 @@ extension NCLoginWeb: WKNavigationDelegate {
         
         if loginFlowV2Available {
             DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
-                NCCommunication.shared.getLoginFlowV2Poll(token: self.loginFlowV2Token, endpoint: self.loginFlowV2Endpoint, customUserAgent: nil, addCustomHeaders: nil) { (server, loginName, appPassword, errorCode, errorDescription) in
+                NCCommunication.shared.getLoginFlowV2Poll(token: self.loginFlowV2Token, endpoint: self.loginFlowV2Endpoint) { (server, loginName, appPassword, errorCode, errorDescription) in
                     if errorCode == 0 && server != nil && loginName != nil && appPassword != nil {
                         self.createAccount(server: server!, username: loginName!, password: appPassword!)
                     }

+ 1 - 1
iOSClient/Main/CCMain.m

@@ -1265,7 +1265,7 @@
         return;
     }
         
-    [[NCCommunication shared] searchLiteralWithServerUrl:appDelegate.activeUrl depth:@"infinity" literal:_searchFileName showHiddenFiles:[CCUtility getShowHiddenFiles] customUserAgent:nil addCustomHeaders:nil user:appDelegate.activeUser account:appDelegate.activeAccount completionHandler:^(NSString *account, NSArray *files, NSInteger errorCode, NSString *errorDescription) {
+    [[NCCommunication shared] searchLiteralWithServerUrl:appDelegate.activeUrl depth:@"infinity" literal:_searchFileName showHiddenFiles:[CCUtility getShowHiddenFiles] customUserAgent:nil addCustomHeaders:nil user:appDelegate.activeUser  completionHandler:^(NSString *account, NSArray *files, NSInteger errorCode, NSString *errorDescription) {
         
          if (errorCode == 0 && [account isEqualToString:appDelegate.activeAccount] && files != nil) {
              

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

@@ -317,7 +317,7 @@ import NCCommunication
                 customUserAgent = NCUtility.sharedInstance.getCustomUserAgentOnlyOffice()
             }
             
-            NCCommunication.shared.NCTextCreateFile(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) { (account, url, errorCode, errorMessage) in
                 
                 if errorCode == 0 && account == self.appDelegate.activeAccount {
                     
@@ -350,7 +350,7 @@ import NCCommunication
         
         if self.editorId == k_editor_collabora {
             
-            NCCommunication.shared.createRichdocuments(path: fileNamePath, templateID: templateIdentifier, customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, url, errorCode, errorDescription) in
+            NCCommunication.shared.createRichdocuments(path: fileNamePath, templateID: templateIdentifier) { (account, url, errorCode, errorDescription) in
                 
                 if errorCode == 0 && account == self.appDelegate.activeAccount && url != nil {
                    
@@ -392,7 +392,7 @@ import NCCommunication
                 customUserAgent = NCUtility.sharedInstance.getCustomUserAgentOnlyOffice()
             }
             
-            NCCommunication.shared.NCTextGetListOfTemplates(customUserAgent: customUserAgent, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, templates, errorCode, errorMessage) in
+            NCCommunication.shared.NCTextGetListOfTemplates(customUserAgent: customUserAgent) { (account, templates, errorCode, errorMessage) in
                 
                 self.indicator.stopAnimating()
                 
@@ -454,7 +454,7 @@ import NCCommunication
         
         if self.editorId == k_editor_collabora  {
                         
-            NCCommunication.shared.getTemplatesRichdocuments(typeTemplate: typeTemplate, customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, templates, errorCode, errorDescription) in
+            NCCommunication.shared.getTemplatesRichdocuments(typeTemplate: typeTemplate) { (account, templates, errorCode, errorDescription) in
                 
                 self.indicator.stopAnimating()
 
@@ -495,7 +495,7 @@ import NCCommunication
         
         let fileNameLocalPath = CCUtility.getDirectoryUserData() + "/" + name + ".png"
 
-        _ = NCCommunication.shared.download(serverUrlFileName: preview, fileNameLocalPath: fileNameLocalPath, customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount, progressHandler: { (progress) in
+        _ = NCCommunication.shared.download(serverUrlFileName: preview, fileNameLocalPath: fileNameLocalPath, progressHandler: { (progress) in
             
         }) { (account, etag, date, lenght, errorCode, errorDescription) in
             

+ 5 - 5
iOSClient/Main/NCDetailViewController.swift

@@ -512,7 +512,7 @@ class NCDetailViewController: UIViewController {
                             self.navigationController?.navigationBar.topItem?.title = ""
                         }
                         
-                        NCCommunication.shared.NCTextOpenFile(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) { (account, url, errorCode, errorMessage) in
                             
                             if errorCode == 0 && account == self.appDelegate.activeAccount && url != nil {
                                 
@@ -553,7 +553,7 @@ class NCDetailViewController: UIViewController {
                 
                 if metadata.url == "" {
                     
-                    NCCommunication.shared.createUrlRichdocuments(fileID: metadata.fileId, customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, url, errorCode, errorDescription) in
+                    NCCommunication.shared.createUrlRichdocuments(fileID: metadata.fileId) { (account, url, errorCode, errorDescription) in
                         
                         if errorCode == 0 && account == self.appDelegate.activeAccount && url != nil {
                             
@@ -706,7 +706,7 @@ extension NCDetailViewController: NCViewerImageViewControllerDelegate, NCViewerI
             
             metadata.session = k_download_session_foreground
             
-            _ = NCCommunication.shared.download(serverUrlFileName: serverUrlFileName, fileNameLocalPath: fileNameLocalPath, customUserAgent: nil, addCustomHeaders: nil, account: metadata.account, progressHandler: { (progress) in
+            _ = NCCommunication.shared.download(serverUrlFileName: serverUrlFileName, fileNameLocalPath: fileNameLocalPath, progressHandler: { (progress) in
                                 
                 self.progress(Float(progress.fractionCompleted))
                 
@@ -743,7 +743,7 @@ extension NCDetailViewController: NCViewerImageViewControllerDelegate, NCViewerI
             let fileNamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, activeUrl: appDelegate.activeUrl)!
             let fileNameLocalPath = CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, fileNameView: metadata.fileNameView)!
                     
-            NCCommunication.shared.downloadPreview(fileNamePathOrFileId: 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(fileNamePathOrFileId: fileNamePath, fileNameLocalPath: fileNameLocalPath, width: Int(k_sizePreview), height: Int(k_sizePreview)) { (account, data, errorCode, errorMessage) in
                 if errorCode == 0 && data != nil {
                     completion(index, UIImage.init(data: data!), metadata, ZoomScale.default, nil)
                 } else {
@@ -817,7 +817,7 @@ extension NCDetailViewController: NCViewerImageViewControllerDelegate, NCViewerI
                 let serverUrlFileName = metadata.serverUrl + "/" + metadata.fileNameView
                 let fileNameLocalPath = CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView)!
                                 
-                _ = NCCommunication.shared.download(serverUrlFileName: serverUrlFileName, fileNameLocalPath: fileNameLocalPath, customUserAgent: nil, addCustomHeaders: nil, account: metadata.account, progressHandler: { (progress) in
+                _ = NCCommunication.shared.download(serverUrlFileName: serverUrlFileName, fileNameLocalPath: fileNameLocalPath, progressHandler: { (progress) in
                                     
                     self.progress(Float(progress.fractionCompleted))
                     

+ 3 - 3
iOSClient/Main/NCMainCommon.swift

@@ -349,7 +349,7 @@ class NCMainCommon: NSObject, NCAudioRecorderViewControllerDelegate, UIDocumentI
                 } else if FileManager.default.fileExists(atPath: fileNameSource) {
                     cell.shared.image = NCUtility.sharedInstance.createAvatar(fileNameSource: fileNameSource, fileNameSourceAvatar: fileNameSourceAvatar)
                 } else {
-                    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
+                    NCCommunication.shared.downloadAvatar(userID: metadata.ownerId, fileNameLocalPath: fileNameSource, size: Int(k_avatar_size)) { (account, data, errorCode, errorMessage) in
                         if errorCode == 0 && account == self.appDelegate.activeAccount {
                             cell.shared.image = NCUtility.sharedInstance.createAvatar(fileNameSource: fileNameSource, fileNameSourceAvatar: fileNameSourceAvatar)
                         }
@@ -613,7 +613,7 @@ class NCMainCommon: NSObject, NCAudioRecorderViewControllerDelegate, UIDocumentI
                             cell.shared.image = avatar
                         }
                     } else {
-                        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
+                        NCCommunication.shared.downloadAvatar(userID: metadata.ownerId, fileNameLocalPath: fileNameSource, size: Int(k_avatar_size)) { (account, data, errorCode, errorMessage) in
                             if errorCode == 0 && account == self.appDelegate.activeAccount {
                                 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 fileNameLocalPath = CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, fileNameView: metadata.fileNameView)!
                     
-            NCCommunication.shared.downloadPreview(fileNamePathOrFileId: 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(fileNamePathOrFileId: fileNamePath, fileNameLocalPath: fileNameLocalPath, width: Int(k_sizePreview), height: Int(k_sizePreview)) { (account, data, errorCode, errorMessage) in
                 
                 if errorCode == 0 && data != nil  {
                     if let image = UIImage.init(data: data!) {

+ 1 - 1
iOSClient/Media/NCMedia.swift

@@ -627,7 +627,7 @@ extension NCMedia {
         }
         loadingSearch = true
         
-        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
+        NCCommunication.shared.searchMedia(lteDateLastModified: lteDate, gteDateLastModified: gteDate, showHiddenFiles: CCUtility.getShowHiddenFiles(), user: appDelegate.activeUser) { (account, files, errorCode, errorDescription) in
             
             self.refreshControl.endRefreshing()
             NCUtility.sharedInstance.stopActivityIndicator()

+ 8 - 8
iOSClient/Networking/NCNetworking.swift

@@ -171,7 +171,7 @@ import NCCommunication
     
     @objc func readFolder(serverUrl: String, account: String, completion: @escaping (_ account: String, _ metadataFolder: tableMetadata?, _ metadatas: [tableMetadata]?, _ errorCode: Int, _ errorDescription: String)->()) {
         
-        NCCommunication.shared.readFileOrFolder(serverUrlFileName: serverUrl, depth: "1", showHiddenFiles: CCUtility.getShowHiddenFiles(), customUserAgent: nil, addCustomHeaders: nil, account: account) { (account, files, errorCode, errorDescription) in
+        NCCommunication.shared.readFileOrFolder(serverUrlFileName: serverUrl, depth: "1", showHiddenFiles: CCUtility.getShowHiddenFiles()) { (account, files, errorCode, errorDescription) in
             
             if errorCode == 0 && files != nil {
                               
@@ -225,7 +225,7 @@ import NCCommunication
     
     @objc func readFile(serverUrlFileName: String, account: String, completion: @escaping (_ account: String, _ metadata: tableMetadata?, _ errorCode: Int, _ errorDescription: String)->()) {
         
-        NCCommunication.shared.readFileOrFolder(serverUrlFileName: serverUrlFileName, depth: "0", showHiddenFiles: CCUtility.getShowHiddenFiles(), customUserAgent: nil, addCustomHeaders: nil, account: account) { (account, files, errorCode, errorDescription) in
+        NCCommunication.shared.readFileOrFolder(serverUrlFileName: serverUrlFileName, depth: "0", showHiddenFiles: CCUtility.getShowHiddenFiles()) { (account, files, errorCode, errorDescription) in
 
             if errorCode == 0 && files != nil {
                 if files?.count ?? 0 == 1 {
@@ -269,7 +269,7 @@ import NCCommunication
         }
         let fileNameFolderUrl = serverUrl + "/" + fileNameFolder
         
-        NCCommunication.shared.createFolder(fileNameFolderUrl, customUserAgent: nil, addCustomHeaders: nil, account: account) { (account, ocId, date, errorCode, errorDescription) in
+        NCCommunication.shared.createFolder(fileNameFolderUrl) { (account, ocId, date, errorCode, errorDescription) in
             if errorCode == 0 {
                 self.readFile(serverUrlFileName: fileNameFolderUrl, account: account) { (account, metadataFolder, errorCode, errorDescription) in
                     if errorCode == 0 {
@@ -339,7 +339,7 @@ import NCCommunication
         }
                 
         let serverUrlFileName = metadata.serverUrl + "/" + metadata.fileName
-        NCCommunication.shared.deleteFileOrFolder(serverUrlFileName, customUserAgent: nil, addCustomHeaders: addCustomHeaders, account: metadata.account) { (account, errorCode, errorDescription) in
+        NCCommunication.shared.deleteFileOrFolder(serverUrlFileName) { (account, errorCode, errorDescription) in
         
             if errorCode == 0 || errorCode == kOCErrorServerPathNotFound {
                 
@@ -382,7 +382,7 @@ import NCCommunication
         let fileName = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, activeUrl: url)!
         let favorite = !metadata.favorite
         
-        NCCommunication.shared.setFavorite(fileName: fileName, favorite: favorite, customUserAgent: nil, addCustomHeaders: nil, account: metadata.account) { (account, errorCode, errorDescription) in
+        NCCommunication.shared.setFavorite(fileName: fileName, favorite: favorite) { (account, errorCode, errorDescription) in
     
             if errorCode == 0 && metadata.account == account {
                 NCManageDatabase.sharedInstance.setMetadataFavorite(ocId: metadata.ocId, favorite: favorite)
@@ -450,7 +450,7 @@ import NCCommunication
         let fileNamePath = metadata.serverUrl + "/" + metadata.fileName
         let fileNameToPath = metadata.serverUrl + "/" + fileNameNew
                 
-        NCCommunication.shared.moveFileOrFolder(serverUrlFileNameSource: fileNamePath, serverUrlFileNameDestination: fileNameToPath, overwrite: false, customUserAgent: nil, addCustomHeaders: nil, account: metadata.account) { (account, errorCode, errorDescription) in
+        NCCommunication.shared.moveFileOrFolder(serverUrlFileNameSource: fileNamePath, serverUrlFileNameDestination: fileNameToPath, overwrite: false) { (account, errorCode, errorDescription) in
                     
             if errorCode == 0 {
                         
@@ -515,7 +515,7 @@ import NCCommunication
         let serverUrlFileNameSource = metadata.serverUrl + "/" + metadata.fileName
         let serverUrlFileNameDestination = serverUrlTo + "/" + metadata.fileName
         
-        NCCommunication.shared.moveFileOrFolder(serverUrlFileNameSource: serverUrlFileNameSource, serverUrlFileNameDestination: serverUrlFileNameDestination, overwrite: overwrite, customUserAgent: nil, addCustomHeaders: nil, account: metadata.account) { (account, errorCode, errorDescription) in
+        NCCommunication.shared.moveFileOrFolder(serverUrlFileNameSource: serverUrlFileNameSource, serverUrlFileNameDestination: serverUrlFileNameDestination, overwrite: overwrite) { (account, errorCode, errorDescription) in
                     
             var metadataNew = tableMetadata()
             
@@ -566,7 +566,7 @@ import NCCommunication
         let serverUrlFileNameSource = metadata.serverUrl + "/" + metadata.fileName
         let serverUrlFileNameDestination = serverUrlTo + "/" + metadata.fileName
         
-        NCCommunication.shared.copyFileOrFolder(serverUrlFileNameSource: serverUrlFileNameSource, serverUrlFileNameDestination: serverUrlFileNameDestination, overwrite: overwrite, customUserAgent: nil, addCustomHeaders: nil, account: metadata.account) { (account, errorCode, errorDescription) in
+        NCCommunication.shared.copyFileOrFolder(serverUrlFileNameSource: serverUrlFileNameSource, serverUrlFileNameDestination: serverUrlFileNameDestination, overwrite: overwrite) { (account, errorCode, errorDescription) in
                     
             self.NotificationPost(name: k_notificationCenter_copyFile, userInfo: ["metadata": metadata, "errorCode": errorCode], errorDescription: errorDescription, completion: completion)
         }

+ 2 - 2
iOSClient/Networking/NCNetworkingCheckRemoteUser.swift

@@ -47,13 +47,13 @@ import NCCommunication
             
             guard let token = CCUtility.getPassword(account) else { return }
             
-            NCCommunication.shared.getRemoteWipeStatus(serverUrl: tableAccount.url, token: token, customUserAgent: nil, addCustomHeaders: nil, account: account) { (account, wipe, errorCode, errorDescriptiuon) in
+            NCCommunication.shared.getRemoteWipeStatus(serverUrl: tableAccount.url, token: token) { (account, wipe, errorCode, errorDescriptiuon) in
                 
                 if wipe {
                     
                     self.appDelegate.deleteAccount(account, wipe: true)
                     NCContentPresenter.shared.messageNotification(tableAccount.user, description: "_wipe_account_", delay: TimeInterval(k_dismissAfterSecond*2), type: NCContentPresenter.messageType.error, errorCode: Int(k_CCErrorInternalError))
-                    NCCommunication.shared.setRemoteWipeCompletition(serverUrl: tableAccount.url, token: token, customUserAgent: nil, addCustomHeaders: nil, account: account) { (account, errorCode, errorDescription) in
+                    NCCommunication.shared.setRemoteWipeCompletition(serverUrl: tableAccount.url, token: token) { (account, errorCode, errorDescription) in
                         print("wipe");
                     }
                     

+ 1 - 1
iOSClient/Networking/NCNetworkingE2EE.swift

@@ -69,7 +69,7 @@ import NCCommunication
             
             DispatchQueue.main.async {
                 
-                NCCommunication.shared.createFolder(fileNameFolderUrl, customUserAgent: nil, addCustomHeaders: ["e2e-token" : e2eToken], account: account) { (account, ocId, date, errorCode, errorDescription) in
+                NCCommunication.shared.createFolder(fileNameFolderUrl, addCustomHeaders: ["e2e-token" : e2eToken]) { (account, ocId, date, errorCode, errorDescription) in
                     if errorCode == 0 {
                         NCNetworking.sharedInstance.readFile(serverUrlFileName: fileNameFolderUrl, account: account) { (account, metadataFolder, errorCode, errorDescription) in
                             if errorCode == 0 {

+ 6 - 6
iOSClient/Networking/NCService.swift

@@ -53,7 +53,7 @@ class NCService: NSObject {
             return
         }
         
-        NCCommunication.shared.getUserProfile(customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, userProfile, errorCode, errorDescription) in
+        NCCommunication.shared.getUserProfile() { (account, userProfile, errorCode, errorDescription) in
                  
             if errorCode == 0 && account == self.appDelegate.activeAccount {
                 
@@ -78,7 +78,7 @@ class NCService: NSObject {
                     let avatarUrl = "\(self.appDelegate.activeUrl!)/index.php/avatar/\(self.appDelegate.activeUser!)/\(k_avatar_size)".addingPercentEncoding(withAllowedCharacters: .urlFragmentAllowed)!
                     let fileNamePath = CCUtility.getDirectoryUserData() + "/" + CCUtility.getStringUser(user, activeUrl: url) + "-" + self.appDelegate.activeUser + ".png"
                     
-                    NCCommunication.shared.downloadContent(serverUrl: avatarUrl, customUserAgent: nil, addCustomHeaders: nil, account: self.appDelegate.activeAccount) { (account, data, errorCode, errorMessage) in
+                    NCCommunication.shared.downloadContent(serverUrl: avatarUrl) { (account, data, errorCode, errorMessage) in
                         if errorCode == 0 {
                             if let image = UIImage(data: data!) {
                                 try? FileManager.default.removeItem(atPath: fileNamePath)
@@ -110,7 +110,7 @@ class NCService: NSObject {
     
     private func requestServerStatus() {
         
-        NCCommunication.shared.getServerStatus(serverUrl: appDelegate.activeUrl, customUserAgent: nil, addCustomHeaders: nil) { (serverProductName, serverVersion, versionMajor, versionMinor, versionMicro, extendedSupport, errorCode, errorMessage) in
+        NCCommunication.shared.getServerStatus(serverUrl: appDelegate.activeUrl) { (serverProductName, serverVersion, versionMajor, versionMinor, versionMicro, extendedSupport, errorCode, errorMessage) in
             if errorCode == 0 {
                 if extendedSupport == false {
                     if serverProductName == "owncloud" {
@@ -129,7 +129,7 @@ class NCService: NSObject {
             return
         }
         
-        NCCommunication.shared.getCapabilities(customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, data, errorCode, errorDescription) in
+        NCCommunication.shared.getCapabilities() { (account, data, errorCode, errorDescription) in
             
             if errorCode == 0 && data != nil {
                 NCManageDatabase.sharedInstance.addCapabilitiesJSon(data!, account: account)
@@ -160,7 +160,7 @@ class NCService: NSObject {
                 // NCTextObtainEditorDetails
                 let serverVersionMajor = NCManageDatabase.sharedInstance.getCapabilitiesServerInt(account: account, elements: NCElementsJSON.shared.capabilitiesVersionMajor)
                 if serverVersionMajor >= k_nextcloud_version_18_0 {
-                    NCCommunication.shared.NCTextObtainEditorDetails(customUserAgent: nil, addCustomHeaders: nil, account: self.appDelegate.activeAccount) { (account, editors, creators, errorCode, errorMessage) in
+                    NCCommunication.shared.NCTextObtainEditorDetails() { (account, editors, creators, errorCode, errorMessage) in
                         if errorCode == 0 && account == self.appDelegate.activeAccount {
                             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)
                 if (isExternalSitesServerEnabled) {
-                    NCCommunication.shared.getExternalSite(customUserAgent: nil, addCustomHeaders: nil, account: account) { (account, externalSites, errorCode, errorDescription) in
+                    NCCommunication.shared.getExternalSite() { (account, externalSites, errorCode, errorDescription) in
                         if errorCode == 0 && account == self.appDelegate.activeAccount {
                             NCManageDatabase.sharedInstance.deleteExternalSites(account: account)
                             for externalSite in externalSites {

+ 0 - 2
iOSClient/Networking/OCNetworking.h

@@ -54,8 +54,6 @@
 
 #pragma mark ===== Comments =====
 
-- (void)putCommentsWithAccount:(NSString *)account fileId:(NSString *)fileId message:(NSString *)message  completion:(void (^)(NSString *account, NSString *message, NSInteger errorCode))completion;
-- (void)updateCommentsWithAccount:(NSString *)account fileId:(NSString *)fileId messageID:(NSString *)messageID message:(NSString *)message  completion:(void (^)(NSString *account, NSString *message, NSInteger errorCode))completion;
 - (void)readMarkCommentsWithAccount:(NSString *)account fileId:(NSString *)fileId completion:(void (^)(NSString *account, NSString *message, NSInteger errorCode))completion;
 - (void)deleteCommentsWithAccount:(NSString *)account fileId:(NSString *)fileId messageID:(NSString *)messageID completion:(void (^)(NSString *account, NSString *message, NSInteger errorCode))completion;
 

+ 0 - 76
iOSClient/Networking/OCNetworking.m

@@ -610,82 +610,6 @@
 #pragma mark ===== Comments =====
 #pragma --------------------------------------------------------------------------------------------
 
-- (void)putCommentsWithAccount:(NSString *)account fileId:(NSString *)fileId message:(NSString *)message  completion:(void (^)(NSString *account, NSString *message, NSInteger errorCode))completion
-{
-    tableAccount *tableAccount = [[NCManageDatabase sharedInstance] getAccountWithPredicate:[NSPredicate predicateWithFormat:@"account == %@", account]];
-    if (tableAccount == nil) {
-        completion(account, NSLocalizedString(@"_error_user_not_available_", nil), k_CCErrorUserNotAvailble);
-    } else if ([CCUtility getPassword:account].length == 0) {
-        completion(account, NSLocalizedString(@"_bad_username_password_", nil), kOCErrorServerUnauthorized);
-    } else if ([CCUtility getCertificateError:account]) {
-        completion(account, NSLocalizedString(@"_ssl_certificate_untrusted_", nil), NSURLErrorServerCertificateUntrusted);
-    }
-    
-    OCCommunication *communication = [OCNetworking sharedManager].sharedOCCommunication;
-    
-    [communication setCredentialsWithUser:tableAccount.user andUserID:tableAccount.userID andPassword:[CCUtility getPassword:account]];
-    [communication setUserAgent:[CCUtility getUserAgent]];
-    
-    [communication putComments:[NSString stringWithFormat:@"%@%@", tableAccount.url, k_dav] fileId:fileId message:message onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *redirectedServer) {
-        
-        completion(account, nil, 0);
-        
-    } failureRequest:^(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer) {
-        
-        NSString *message;
-        NSInteger errorCode = response.statusCode;
-        
-        if (errorCode == 0 || (errorCode >= 200 && errorCode < 300))
-            errorCode = error.code;
-        
-        // Error
-        if (errorCode == 503)
-            message = NSLocalizedString(@"_server_error_retry_", nil);
-        else
-            message = [error.userInfo valueForKey:@"NSLocalizedDescription"];
-        
-        completion(account, message, errorCode);
-    }];
-}
-
-- (void)updateCommentsWithAccount:(NSString *)account fileId:(NSString *)fileId messageID:(NSString *)messageID message:(NSString *)message  completion:(void (^)(NSString *account, NSString *message, NSInteger errorCode))completion
-{
-    tableAccount *tableAccount = [[NCManageDatabase sharedInstance] getAccountWithPredicate:[NSPredicate predicateWithFormat:@"account == %@", account]];
-    if (tableAccount == nil) {
-        completion(account, NSLocalizedString(@"_error_user_not_available_", nil), k_CCErrorUserNotAvailble);
-    } else if ([CCUtility getPassword:account].length == 0) {
-        completion(account, NSLocalizedString(@"_bad_username_password_", nil), kOCErrorServerUnauthorized);
-    } else if ([CCUtility getCertificateError:account]) {
-        completion(account, NSLocalizedString(@"_ssl_certificate_untrusted_", nil), NSURLErrorServerCertificateUntrusted);
-    }
-    
-    OCCommunication *communication = [OCNetworking sharedManager].sharedOCCommunication;
-    
-    [communication setCredentialsWithUser:tableAccount.user andUserID:tableAccount.userID andPassword:[CCUtility getPassword:account]];
-    [communication setUserAgent:[CCUtility getUserAgent]];
-    
-    [communication updateComments:[NSString stringWithFormat:@"%@%@", tableAccount.url, k_dav] fileId:fileId messageID:messageID message:message onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *redirectedServer) {
-        
-        completion(account, nil, 0);
-        
-    } failureRequest:^(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer) {
-        
-        NSString *message;
-        NSInteger errorCode = response.statusCode;
-        
-        if (errorCode == 0 || (errorCode >= 200 && errorCode < 300))
-            errorCode = error.code;
-        
-        // Error
-        if (errorCode == 503)
-            message = NSLocalizedString(@"_server_error_retry_", nil);
-        else
-            message = [error.userInfo valueForKey:@"NSLocalizedDescription"];
-        
-        completion(account, message, errorCode);
-    }];
-}
-
 - (void)readMarkCommentsWithAccount:(NSString *)account fileId:(NSString *)fileId completion:(void (^)(NSString *account, NSString *message, NSInteger errorCode))completion
 {
     tableAccount *tableAccount = [[NCManageDatabase sharedInstance] getAccountWithPredicate:[NSPredicate predicateWithFormat:@"account == %@", account]];

+ 3 - 3
iOSClient/Notification/NCNotification.swift

@@ -240,7 +240,7 @@ class NCNotification: UITableViewController, NCNotificationCellDelegate, DZNEmpt
     
     func tapRemove(with notification: NCCommunicationNotifications?) {
            
-        NCCommunication.shared.setNotification(serverUrl:nil, idNotification: notification!.idNotification , method: "DELETE", customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, errorCode, errorDescription) in
+        NCCommunication.shared.setNotification(serverUrl:nil, idNotification: notification!.idNotification , method: "DELETE") { (account, errorCode, errorDescription) in
             if errorCode == 0 && account == self.appDelegate.activeAccount {
                                 
                 if let index = self.notifications.firstIndex(where: {$0.idNotification == notification!.idNotification})  {
@@ -266,7 +266,7 @@ class NCNotification: UITableViewController, NCNotificationCellDelegate, DZNEmpt
                         let serverUrl = action["link"].stringValue
                         let method = action["type"].stringValue
                             
-                        NCCommunication.shared.setNotification(serverUrl: serverUrl, idNotification: 0, method: method, customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, errorCode, errorDescription) in
+                        NCCommunication.shared.setNotification(serverUrl: serverUrl, idNotification: 0, method: method) { (account, errorCode, errorDescription) in
                             
                             if errorCode == 0 && account == self.appDelegate.activeAccount {
                                                         
@@ -294,7 +294,7 @@ class NCNotification: UITableViewController, NCNotificationCellDelegate, DZNEmpt
     
         NCUtility.sharedInstance.startActivityIndicator(view: self.navigationController?.view, bottom: 0)
 
-        NCCommunication.shared.getNotifications(customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, notifications, errorCode, errorDescription) in
+        NCCommunication.shared.getNotifications() { (account, notifications, errorCode, errorDescription) in
          
             if errorCode == 0 && account == self.appDelegate.activeAccount {
                     

+ 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 *fileNameLocalPath = [CCUtility getDirectoryProviderStorageOcId:self.metadata.ocId fileNameView:self.metadata.fileNameView];
     
-    [[NCCommunication shared] downloadPreviewWithFileNamePathOrFileId:fileNamePath fileNameLocalPath:fileNameLocalPath width:k_sizePreview height:k_sizePreview customUserAgent:nil addCustomHeaders:nil account:self.metadata.account downloadFromTrash:false useInternalEndpoint:true completionHandler:^(NSString *account, NSData *data, NSInteger errorCode, NSString *errorDescription) {
+    [[NCCommunication shared] downloadPreviewWithFileNamePathOrFileId:fileNamePath fileNameLocalPath:fileNameLocalPath width:k_sizePreview height:k_sizePreview customUserAgent:nil addCustomHeaders:nil downloadFromTrash:false useInternalEndpoint:true completionHandler:^(NSString *account, NSData *data, NSInteger errorCode, NSString *errorDescription) {
 
         if (errorCode == 0) {
             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)
         
         let fileNamePath = CCUtility.returnFileNamePath(fromFileName: k_fileNameRichWorkspace, serverUrl: serverUrl, activeUrl: appDelegate.activeUrl)!
-        NCCommunication.shared.NCTextCreateFile(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: "") { (account, url, errorCode, errorMessage) in
             
             NCUtility.sharedInstance.stopActivityIndicator()
             
@@ -75,7 +75,7 @@ import NCCommunication
                 NCUtility.sharedInstance.startActivityIndicator(view: viewController.view, bottom: 0)
                 
                 let fileNamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, activeUrl: appDelegate.activeUrl)!
-                NCCommunication.shared.NCTextOpenFile(fileNamePath: fileNamePath, editor: "text", customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, url, errorCode, errorMessage) in
+                NCCommunication.shared.NCTextOpenFile(fileNamePath: fileNamePath, editor: "text") { (account, url, errorCode, errorMessage) in
                     
                     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 let image = UIImage(contentsOfFile: fileNameLocalPath) { sharedWithYouByImage.image = image }
             } else {
-                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
+                NCCommunication.shared.downloadAvatar(userID: metadata!.ownerId, fileNameLocalPath: fileNameLocalPath, size: Int(k_avatar_size)) { (account, data, errorCode, errorMessage) in
                     if errorCode == 0 && account == self.appDelegate.activeAccount && UIImage(data: data!) != nil {
                         if let image = UIImage(contentsOfFile: fileNameLocalPath) {
                             self.sharedWithYouByImage.image = image
@@ -283,7 +283,7 @@ class NCShare: UIViewController, UIGestureRecognizerDelegate, NCShareLinkCellDel
                 if let image = UIImage(contentsOfFile: fileNameLocalPath) { cell.imageItem.image = image }
             } else {
                 DispatchQueue.global().async {
-                    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
+                    NCCommunication.shared.downloadAvatar(userID: item.name, fileNameLocalPath: fileNameLocalPath, size: Int(k_avatar_size)) { (account, data, errorCode, errorMessage) in
                         if errorCode == 0 && account == self.appDelegate.activeAccount && UIImage(data: data!) != nil {
                             if let image = UIImage(contentsOfFile: fileNameLocalPath) {
                                 cell.imageItem.image = image
@@ -375,7 +375,7 @@ extension NCShare: UITableViewDataSource {
                     if let image = UIImage(contentsOfFile: fileNameLocalPath) { cell.imageItem.image = image }
                 } else {
                     DispatchQueue.global().async {
-                        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
+                        NCCommunication.shared.downloadAvatar(userID: tableShare.shareWith, fileNameLocalPath: fileNameLocalPath, size: Int(k_avatar_size)) { (account, data, errorCode, errorMessage) in
                             if errorCode == 0 && account == self.appDelegate.activeAccount && UIImage(data: data!) != nil {
                                 if let image = UIImage(contentsOfFile: fileNameLocalPath) {
                                     cell.imageItem.image = image

+ 9 - 9
iOSClient/Share/NCShareComments.swift

@@ -104,7 +104,7 @@ class NCShareComments: UIViewController, NCShareCommentsCellDelegate {
         
         guard let metadata = self.metadata else { return }
 
-        NCCommunication.shared.getComments(fileId: metadata.fileId, customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, comments, errorCode, errorDescription) in
+        NCCommunication.shared.getComments(fileId: metadata.fileId) { (account, comments, errorCode, errorDescription) in
             if errorCode == 0 && comments != nil {
                 NCManageDatabase.sharedInstance.addComments(comments!, account: metadata.account, objectId: metadata.fileId)
                 self.tableView.reloadData()
@@ -124,14 +124,14 @@ class NCShareComments: UIViewController, NCShareCommentsCellDelegate {
         guard let metadata = self.metadata else { return }
         if message.count == 0 { return }
 
-        OCNetworking.sharedManager()?.putComments(withAccount: appDelegate.activeAccount, fileId: metadata.fileId, message: message, completion: { (account, message, errorCode) in
+        NCCommunication.shared.putComments(fileId: metadata.fileId, message: message) { (account, errorCode, errorDescription) in
             if errorCode == 0 {
                 self.newCommentField.text = ""
                 self.reloadData()
             } else {
-                NCContentPresenter.shared.messageNotification("_share_", description: message, delay: TimeInterval(k_dismissAfterSecond), type: NCContentPresenter.messageType.error, errorCode: errorCode)
+                NCContentPresenter.shared.messageNotification("_share_", description: errorDescription, delay: TimeInterval(k_dismissAfterSecond), type: NCContentPresenter.messageType.error, errorCode: errorCode)
             }
-        })
+        }
     }
     
     func tapMenu(with tableComments: tableComments?, sender: Any) {
@@ -157,13 +157,13 @@ class NCShareComments: UIViewController, NCShareCommentsCellDelegate {
                     alert.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default, handler: { action in
                         if let message = alert.textFields?.first?.text {
                             if message != "" {
-                                OCNetworking.sharedManager()?.updateComments(withAccount: metadata.account, fileId: metadata.fileId, messageID: tableComments.messageID, message: message, completion: { (account, message, errorCode) in
+                                NCCommunication.shared.updateComments(fileId: metadata.fileId, messageId: tableComments.messageId, message: message) { (account, errorCode, errorDescription) in
                                     if errorCode == 0 {
                                         self.reloadData()
                                     } else {
-                                        NCContentPresenter.shared.messageNotification("_share_", description: message, delay: TimeInterval(k_dismissAfterSecond), type: NCContentPresenter.messageType.error, errorCode: errorCode)
+                                        NCContentPresenter.shared.messageNotification("_share_", description: errorDescription, delay: TimeInterval(k_dismissAfterSecond), type: NCContentPresenter.messageType.error, errorCode: errorCode)
                                     }
-                                })
+                                }
                             }
                         }
                     }))
@@ -181,7 +181,7 @@ class NCShareComments: UIViewController, NCShareCommentsCellDelegate {
                     guard let metadata = self.metadata else { return }
                     guard let tableComments = tableComments else { return }
 
-                    OCNetworking.sharedManager()?.deleteComments(withAccount: metadata.account, fileId: metadata.fileId, messageID: tableComments.messageID, completion: { (account, message, errorCode) in
+                    OCNetworking.sharedManager()?.deleteComments(withAccount: metadata.account, fileId: metadata.fileId, messageID: tableComments.messageId, completion: { (account, message, errorCode) in
                         if errorCode == 0 {
                             self.reloadData()
                         } else {
@@ -252,7 +252,7 @@ extension NCShareComments: UITableViewDataSource {
                 if let image = UIImage(contentsOfFile: fileNameLocalPath) { cell.imageItem.image = image }
             } else {
                 DispatchQueue.global().async {
-                    NCCommunication.shared.downloadAvatar(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) { (account, data, errorCode, errorMessage) in
                         if errorCode == 0 && UIImage(data: data!) != nil {
                             cell.imageItem.image = UIImage(named: "avatar")
                         }

+ 1 - 1
iOSClient/Synchronize/CCSynchronize.m

@@ -383,7 +383,7 @@
 {
     [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
     
-    [[NCCommunication shared] readFileOrFolderWithServerUrlFileName:self.serverUrl depth:@"1" showHiddenFiles:[CCUtility getShowHiddenFiles] customUserAgent:nil addCustomHeaders:nil account:self.account completionHandler:^(NSString *account, NSArray *files, NSInteger errorCode, NSString *errorDescription) {
+    [[NCCommunication shared] readFileOrFolderWithServerUrlFileName:self.serverUrl depth:@"1" showHiddenFiles:[CCUtility getShowHiddenFiles] customUserAgent:nil addCustomHeaders:nil completionHandler:^(NSString *account, NSArray *files, NSInteger errorCode, NSString *errorDescription) {
                
         [[NCManageDatabase sharedInstance] convertNCCommunicationFilesToMetadatas:files useMetadataFolder:true account:account completion:^(tableMetadata *metadataFolder, NSArray<tableMetadata *> *metadatasFolder, NSArray<tableMetadata *> *metadatas) {
             

+ 5 - 5
iOSClient/Trash/NCTrash.swift

@@ -661,7 +661,7 @@ extension NCTrash {
     
     @objc func loadListingTrash() {
         
-        NCCommunication.shared.listingTrash(showHiddenFiles: false, customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, items, errorCode, errorDescription) in
+        NCCommunication.shared.listingTrash(showHiddenFiles: false) { (account, items, errorCode, errorDescription) in
             self.refreshControl.endRefreshing()
          
             if errorCode == 0 && account == self.appDelegate.activeAccount && items != nil {
@@ -693,7 +693,7 @@ extension NCTrash {
         let fileNameFrom = appDelegate.activeUrl + tableTrash.filePath + tableTrash.fileName
         let fileNameTo = appDelegate.activeUrl + k_dav + "/trashbin/" + appDelegate.activeUserID + "/restore/" + tableTrash.fileName
         
-        NCCommunication.shared.moveFileOrFolder(serverUrlFileNameSource: fileNameFrom, serverUrlFileNameDestination: fileNameTo, overwrite: true, customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, errorCode, errorDescription) in
+        NCCommunication.shared.moveFileOrFolder(serverUrlFileNameSource: fileNameFrom, serverUrlFileNameDestination: fileNameTo, overwrite: true) { (account, errorCode, errorDescription) in
             if errorCode == 0 && account == self.appDelegate.activeAccount {
                 NCManageDatabase.sharedInstance.deleteTrash(fileId: fileId, account: account)
                 self.loadDatasource()
@@ -709,7 +709,7 @@ extension NCTrash {
         
         let serverUrlFileName = appDelegate.activeUrl + "/remote.php/dav/trashbin/" + appDelegate.activeUserID + "/trash"
 
-        NCCommunication.shared.deleteFileOrFolder(serverUrlFileName, customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, errorCode, errorDescription) in
+        NCCommunication.shared.deleteFileOrFolder(serverUrlFileName) { (account, errorCode, errorDescription) in
             if errorCode == 0 && account == self.appDelegate.activeAccount {
                 NCManageDatabase.sharedInstance.deleteTrash(fileId: nil, account: self.appDelegate.activeAccount)
             } else if errorCode != 0 {
@@ -729,7 +729,7 @@ extension NCTrash {
         
         let serverUrlFileName = appDelegate.activeUrl + tableTrash.filePath + tableTrash.fileName
         
-        NCCommunication.shared.deleteFileOrFolder(serverUrlFileName, customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount) { (account, errorCode, errorDescription) in
+        NCCommunication.shared.deleteFileOrFolder(serverUrlFileName) { (account, errorCode, errorDescription) in
             if errorCode == 0 && account == self.appDelegate.activeAccount {
                 NCManageDatabase.sharedInstance.deleteTrash(fileId: fileId, account: account)
                 self.loadDatasource()
@@ -745,7 +745,7 @@ extension NCTrash {
         
         let fileNameLocalPath = CCUtility.getDirectoryProviderStorageIconOcId(tableTrash.fileId, fileNameView: tableTrash.fileName)!
         
-        NCCommunication.shared.downloadPreview(fileNamePathOrFileId: tableTrash.fileId, fileNameLocalPath: fileNameLocalPath, width: Int(k_sizePreview), height: Int(k_sizePreview), customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount, downloadFromTrash: true) { (account, data, errorCode, errorDescription) in
+        NCCommunication.shared.downloadPreview(fileNamePathOrFileId: tableTrash.fileId, fileNameLocalPath: fileNameLocalPath, width: Int(k_sizePreview), height: Int(k_sizePreview), downloadFromTrash: true) { (account, data, errorCode, errorDescription) in
             
             if errorCode == 0 && data != nil && account == self.appDelegate.activeAccount {
                 if let cell = self.collectionView.cellForItem(at: indexPath), let image = UIImage.init(data: data!) {

+ 1 - 1
iOSClient/Utility/NCUtility.swift

@@ -176,7 +176,7 @@ class NCUtility: NSObject {
         
         if !FileManager.default.fileExists(atPath: imageNamePath) || rewrite == true {
             
-            NCCommunication.shared.downloadContent(serverUrl: iconURL.absoluteString, customUserAgent: nil, addCustomHeaders: nil, account: account) { (account, data, errorCode, errorMessage) in
+            NCCommunication.shared.downloadContent(serverUrl: iconURL.absoluteString) { (account, data, errorCode, errorMessage) in
                
                 if errorCode == 0 && data != nil {
                 

+ 3 - 4
iOSClient/Viewer/NCViewerRichdocument.swift

@@ -145,7 +145,7 @@ class NCViewerRichdocument: WKWebView, WKNavigationDelegate, WKScriptMessageHand
                             NCUtility.sharedInstance.startActivityIndicator(view: self, bottom: 0)
                         }
                         
-                        _ = NCCommunication.shared.download(serverUrlFileName: urlString, fileNameLocalPath: fileNameLocalPath, customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount, progressHandler: { (progress) in
+                        _ = NCCommunication.shared.download(serverUrlFileName: urlString, fileNameLocalPath: fileNameLocalPath, progressHandler: { (progress) in
                             
                         }, completionHandler: { (account, etag, date, lenght, errorCode, errorDescription) in
                             
@@ -170,7 +170,6 @@ class NCViewerRichdocument: WKWebView, WKNavigationDelegate, WKScriptMessageHand
                             } else {
                                 NCContentPresenter.shared.messageNotification("_error_", description: errorDescription, delay: TimeInterval(k_dismissAfterSecond), type: NCContentPresenter.messageType.error, errorCode: errorCode)
                             }
-                            
                         })
                     }
                 } else if param["MessageName"] as? String == "fileRename" {
@@ -210,7 +209,7 @@ class NCViewerRichdocument: WKWebView, WKNavigationDelegate, WKScriptMessageHand
             
             let path = CCUtility.returnFileNamePath(fromFileName: metadata!.fileName, serverUrl: serverUrl!, activeUrl: appDelegate.activeUrl)!
             
-            NCCommunication.shared.createAssetRichdocuments(path: path, customUserAgent: nil, addCustomHeaders: nil, account: metadata!.account) { (account, url, errorCode, errorDescription) in
+            NCCommunication.shared.createAssetRichdocuments(path: path) { (account, url, errorCode, errorDescription) in
                 if errorCode == 0 && account == self.appDelegate.activeAccount {
                     let functionJS = "OCA.RichDocuments.documentsMain.postAsset('\(metadata!.fileNameView)', '\(url!)')"
                     self.evaluateJavaScript(functionJS, completionHandler: { (result, error) in })
@@ -227,7 +226,7 @@ class NCViewerRichdocument: WKWebView, WKNavigationDelegate, WKScriptMessageHand
         
         let path = CCUtility.returnFileNamePath(fromFileName: metadata!.fileName, serverUrl: serverUrl!, activeUrl: appDelegate.activeUrl)!
         
-        NCCommunication.shared.createAssetRichdocuments(path: path, customUserAgent: nil, addCustomHeaders: nil, account: metadata!.account) { (account, url, errorCode, errorDescription) in
+        NCCommunication.shared.createAssetRichdocuments(path: path) { (account, url, errorCode, errorDescription) in
             if errorCode == 0 && account == self.appDelegate.activeAccount {
                 let functionJS = "OCA.RichDocuments.documentsMain.postAsset('\(metadata.fileNameView)', '\(url!)')"
                 self.evaluateJavaScript(functionJS, completionHandler: { (result, error) in })