Browse Source

Merge pull request #1741 from nextcloud/fix/readShares

Fix read shares
Marino Faggiana 3 years ago
parent
commit
d581ea78de

+ 1 - 1
iOSClient/Networking/NCService.swift

@@ -180,7 +180,7 @@ class NCService: NSObject {
                 // File Sharing
                 let isFilesSharingEnabled = NCManageDatabase.shared.getCapabilitiesServerBool(account: account, elements: NCElementsJSON.shared.capabilitiesFileSharingApiEnabled, exists: false)
                 if isFilesSharingEnabled {
-                    NCCommunication.shared.readShares(queue: NCCommunicationCommon.shared.backgroundQueue) { (account, shares, errorCode, ErrorDescription) in
+                    NCCommunication.shared.readShares(parameters: NCCShareParameter(), queue: NCCommunicationCommon.shared.backgroundQueue) { (account, shares, errorCode, ErrorDescription) in
                         if errorCode == 0 {
                             NCManageDatabase.shared.deleteTableShare(account: account)
                             if shares != nil {

+ 2 - 1
iOSClient/Share/NCShareNetworking.swift

@@ -44,7 +44,8 @@ class NCShareNetworking: NSObject {
     func readShare() {
         NCUtility.shared.startActivityIndicator(backgroundView: view, blurEffect: false)
         let filenamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, urlBase: urlBase, account: metadata.account)!
-        NCCommunication.shared.readShares(path: filenamePath) { (account, shares, errorCode, errorDescription) in
+        let parameter = NCCShareParameter(path: filenamePath)
+        NCCommunication.shared.readShares(parameters: parameter) { (account, shares, errorCode, errorDescription) in
             NCUtility.shared.stopActivityIndicator()
              if errorCode == 0 && shares != nil {
                 NCManageDatabase.shared.addShare(urlBase: self.urlBase, account: self.metadata.account, shares: shares!)

+ 1 - 1
iOSClient/Shares/NCShares.swift

@@ -74,7 +74,7 @@ class NCShares: NCCollectionViewCommon  {
         collectionView?.reloadData()
                     
         // Shares network
-        NCCommunication.shared.readShares(queue: NCCommunicationCommon.shared.backgroundQueue) { (account, shares, errorCode, ErrorDescription) in
+        NCCommunication.shared.readShares(parameters: NCCShareParameter(), queue: NCCommunicationCommon.shared.backgroundQueue) { (account, shares, errorCode, ErrorDescription) in
                 
             DispatchQueue.main.async {
                 self.refreshControl.endRefreshing()