marinofaggiana 4 жил өмнө
parent
commit
c8d32bb88d

+ 1 - 1
iOSClient/Share/NCShare.swift

@@ -301,7 +301,7 @@ class NCShare: UIViewController, UIGestureRecognizerDelegate, NCShareLinkCellDel
         
         
         dropDown.selectionAction = { [weak self] (index, item) in
         dropDown.selectionAction = { [weak self] (index, item) in
             let sharee = sharees[index]
             let sharee = sharees[index]
-            self!.networking?.shareUserAndGroup(name: sharee.label, shareeType: sharee.shareType, metadata: self!.metadata!)
+            self!.networking?.shareUserAndGroup(name: sharee.label, shareType: sharee.shareType, metadata: self!.metadata!)
         }
         }
         
         
         dropDown.show()
         dropDown.show()

+ 14 - 13
iOSClient/Share/NCShareLinkMenuView.swift

@@ -247,7 +247,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
             permission = UtilsFramework.getPermissionsValue(byCanEdit: false, andCanCreate: false, andCanChange: false, andCanDelete: false, andCanShare: false, andIsFolder: metadata.directory)
             permission = UtilsFramework.getPermissionsValue(byCanEdit: false, andCanCreate: false, andCanChange: false, andCanDelete: false, andCanShare: false, andIsFolder: metadata.directory)
         }
         }
         
         
-        //networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: permission, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
+        networking?.updateShare(idShare: tableShare.idShare, password: nil, permission: permission, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
     }
     }
     
     
     // Read Only (directory)
     // Read Only (directory)
@@ -260,7 +260,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
         if sender.isOn && permission != tableShare.permissions {
         if sender.isOn && permission != tableShare.permissions {
             switchAllowUploadAndEditing.setOn(false, animated: false)
             switchAllowUploadAndEditing.setOn(false, animated: false)
             switchFileDrop.setOn(false, animated: false)
             switchFileDrop.setOn(false, animated: false)
-//            networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: permission, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
+            networking?.updateShare(idShare: tableShare.idShare, password: nil, permission: permission, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
         } else {
         } else {
             sender.setOn(true, animated: false)
             sender.setOn(true, animated: false)
         }
         }
@@ -276,7 +276,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
         if sender.isOn && permission != tableShare.permissions {
         if sender.isOn && permission != tableShare.permissions {
             switchReadOnly.setOn(false, animated: false)
             switchReadOnly.setOn(false, animated: false)
             switchFileDrop.setOn(false, animated: false)
             switchFileDrop.setOn(false, animated: false)
-//            networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: permission, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
+            networking?.updateShare(idShare: tableShare.idShare, password: nil, permission: permission, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
         } else {
         } else {
             sender.setOn(true, animated: false)
             sender.setOn(true, animated: false)
         }
         }
@@ -291,7 +291,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
         if sender.isOn && permission != tableShare.permissions {
         if sender.isOn && permission != tableShare.permissions {
             switchReadOnly.setOn(false, animated: false)
             switchReadOnly.setOn(false, animated: false)
             switchAllowUploadAndEditing.setOn(false, animated: false)
             switchAllowUploadAndEditing.setOn(false, animated: false)
-//            networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: permission, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
+            networking?.updateShare(idShare: tableShare.idShare, password: nil, permission: permission, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
         } else {
         } else {
             sender.setOn(true, animated: false)
             sender.setOn(true, animated: false)
         }
         }
@@ -301,8 +301,8 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
     @IBAction func switchHideDownloadChanged(sender: UISwitch) {
     @IBAction func switchHideDownloadChanged(sender: UISwitch) {
         
         
         guard let tableShare = self.tableShare else { return }
         guard let tableShare = self.tableShare else { return }
-
-//        networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: 0, note: nil, expirationTime: nil, hideDownload: sender.isOn)
+        
+        networking?.updateShare(idShare: tableShare.idShare, password: nil, permission: 0, note: nil, expirationTime: nil, hideDownload: sender.isOn)
     }
     }
     
     
     // Password protect
     // Password protect
@@ -315,15 +315,15 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
             fieldPasswordProtect.text = ""
             fieldPasswordProtect.text = ""
             fieldPasswordProtect.becomeFirstResponder()
             fieldPasswordProtect.becomeFirstResponder()
         } else {
         } else {
-//            networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: "", permission: 0, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
+            networking?.updateShare(idShare: tableShare.idShare, password: "", permission: 0, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
         }
         }
     }
     }
     
     
     @IBAction func fieldPasswordProtectDidEndOnExit(textField: UITextField) {
     @IBAction func fieldPasswordProtectDidEndOnExit(textField: UITextField) {
         
         
         guard let tableShare = self.tableShare else { return }
         guard let tableShare = self.tableShare else { return }
-
-//        networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: fieldPasswordProtect.text, permission: 0, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
+        
+        networking?.updateShare(idShare: tableShare.idShare, password: fieldPasswordProtect.text, permission: 0, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
     }
     }
     
     
     // Set expiration date
     // Set expiration date
@@ -335,7 +335,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
             fieldSetExpirationDate.isEnabled = true
             fieldSetExpirationDate.isEnabled = true
             fieldSetExpirationDate(sender: fieldSetExpirationDate)
             fieldSetExpirationDate(sender: fieldSetExpirationDate)
         } else {
         } else {
-//            networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: 0, note: nil, expirationTime: "", hideDownload: tableShare.hideDownload)
+            networking?.updateShare(idShare: tableShare.idShare, password: nil, permission: 0, note: nil, expirationTime: "", hideDownload: tableShare.hideDownload)
         }
         }
     }
     }
     
     
@@ -357,7 +357,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
         guard let tableShare = self.tableShare else { return }
         guard let tableShare = self.tableShare else { return }
         if fieldNoteToRecipient.text == nil { return }
         if fieldNoteToRecipient.text == nil { return }
         
         
-//        networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: 0, note: fieldNoteToRecipient.text, expirationTime: nil, hideDownload: tableShare.hideDownload)
+        networking?.updateShare(idShare: tableShare.idShare, password: nil, permission: 0, note: fieldNoteToRecipient.text, expirationTime: nil, hideDownload: tableShare.hideDownload)
     }
     }
     
     
     // Delete share link
     // Delete share link
@@ -365,7 +365,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
         
         
         guard let tableShare = self.tableShare else { return }
         guard let tableShare = self.tableShare else { return }
         
         
-//        networking?.unShare(idRemoteShared: tableShare.idRemoteShared)
+        networking?.unShare(idShare: tableShare.idShare)
     }
     }
     
     
     // Add another link
     // Add another link
@@ -415,7 +415,8 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
 
 
             dateFormatter.dateFormat = "YYYY-MM-dd"
             dateFormatter.dateFormat = "YYYY-MM-dd"
             let expirationTime = dateFormatter.string(from: date)
             let expirationTime = dateFormatter.string(from: date)
-//            networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: 0, note: nil, expirationTime: expirationTime, hideDownload: tableShare.hideDownload)
+            
+            networking?.updateShare(idShare: tableShare.idShare, password: nil, permission: 0, note: nil, expirationTime: expirationTime, hideDownload: tableShare.hideDownload)
         }
         }
     }
     }
     
     

+ 1 - 1
iOSClient/Share/NCShareNetworking.swift

@@ -127,7 +127,7 @@ class NCShareNetworking: NSObject {
         }
         }
     }
     }
     
     
-    func shareUserAndGroup(name: String, shareeType: Int, metadata: tableMetadata) {
+    func shareUserAndGroup(name: String, shareType: Int, metadata: tableMetadata) {
         NCUtility.sharedInstance.startActivityIndicator(view: view)
         NCUtility.sharedInstance.startActivityIndicator(view: view)
         let fileName = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, activeUrl: activeUrl)!
         let fileName = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, activeUrl: activeUrl)!
         var permission: Int = 0
         var permission: Int = 0

+ 9 - 8
iOSClient/Share/NCShareUserMenuView.swift

@@ -216,7 +216,7 @@ class NCShareUserMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
             }
             }
         }
         }
         
         
-        //networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: permission, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
+        networking?.updateShare(idShare: tableShare.idShare, password: nil, permission: permission, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
     }
     }
     
     
     @IBAction func switchCanCreate(sender: UISwitch) {
     @IBAction func switchCanCreate(sender: UISwitch) {
@@ -231,7 +231,7 @@ class NCShareUserMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
 
 
         let permission = UtilsFramework.getPermissionsValue(byCanEdit: canEdit, andCanCreate: sender.isOn, andCanChange: canChange, andCanDelete: canDelete, andCanShare: canShare, andIsFolder: metadata.directory)
         let permission = UtilsFramework.getPermissionsValue(byCanEdit: canEdit, andCanCreate: sender.isOn, andCanChange: canChange, andCanDelete: canDelete, andCanShare: canShare, andIsFolder: metadata.directory)
 
 
-        //networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: permission, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
+        networking?.updateShare(idShare: tableShare.idShare, password: nil, permission: permission, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
     }
     }
     
     
     @IBAction func switchCanChange(sender: UISwitch) {
     @IBAction func switchCanChange(sender: UISwitch) {
@@ -246,7 +246,7 @@ class NCShareUserMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
         
         
         let permission = UtilsFramework.getPermissionsValue(byCanEdit: canEdit, andCanCreate: canCreate, andCanChange: sender.isOn, andCanDelete: canDelete, andCanShare: canShare, andIsFolder: metadata.directory)
         let permission = UtilsFramework.getPermissionsValue(byCanEdit: canEdit, andCanCreate: canCreate, andCanChange: sender.isOn, andCanDelete: canDelete, andCanShare: canShare, andIsFolder: metadata.directory)
 
 
-        //networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: permission, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
+        networking?.updateShare(idShare: tableShare.idShare, password: nil, permission: permission, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
     }
     }
     
     
     @IBAction func switchCanDelete(sender: UISwitch) {
     @IBAction func switchCanDelete(sender: UISwitch) {
@@ -261,7 +261,7 @@ class NCShareUserMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
         
         
         let permission = UtilsFramework.getPermissionsValue(byCanEdit: canEdit, andCanCreate: canCreate, andCanChange: canChange, andCanDelete: sender.isOn, andCanShare: canShare, andIsFolder: metadata.directory)
         let permission = UtilsFramework.getPermissionsValue(byCanEdit: canEdit, andCanCreate: canCreate, andCanChange: canChange, andCanDelete: sender.isOn, andCanShare: canShare, andIsFolder: metadata.directory)
 
 
-        //networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: permission, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
+        networking?.updateShare(idShare: tableShare.idShare, password: nil, permission: permission, note: nil, expirationTime: nil, hideDownload: tableShare.hideDownload)
     }
     }
     
     
     // Set expiration date
     // Set expiration date
@@ -273,7 +273,7 @@ class NCShareUserMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
             fieldSetExpirationDate.isEnabled = true
             fieldSetExpirationDate.isEnabled = true
             fieldSetExpirationDate(sender: fieldSetExpirationDate)
             fieldSetExpirationDate(sender: fieldSetExpirationDate)
         } else {
         } else {
-            //networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: 0, note: nil, expirationTime: "", hideDownload: tableShare.hideDownload)
+            networking?.updateShare(idShare: tableShare.idShare, password: nil, permission: 0, note: nil, expirationTime: "", hideDownload: tableShare.hideDownload)
         }
         }
     }
     }
     
     
@@ -295,7 +295,7 @@ class NCShareUserMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
         guard let tableShare = self.tableShare else { return }
         guard let tableShare = self.tableShare else { return }
         if fieldNoteToRecipient.text == nil { return }
         if fieldNoteToRecipient.text == nil { return }
         
         
-        //networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: 0, note: fieldNoteToRecipient.text, expirationTime: nil, hideDownload: tableShare.hideDownload)
+        networking?.updateShare(idShare: tableShare.idShare, password: nil, permission: 0, note: fieldNoteToRecipient.text, expirationTime: nil, hideDownload: tableShare.hideDownload)
     }
     }
     
     
     // Unshare
     // Unshare
@@ -303,7 +303,7 @@ class NCShareUserMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
         
         
         guard let tableShare = self.tableShare else { return }
         guard let tableShare = self.tableShare else { return }
         
         
-        //networking?.unShare(idRemoteShared: tableShare.idRemoteShared)
+        networking?.unShare(idShare: tableShare.idShare)
     }
     }
     
     
     // MARK: - Delegate networking
     // MARK: - Delegate networking
@@ -347,7 +347,8 @@ class NCShareUserMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
             
             
             dateFormatter.dateFormat = "YYYY-MM-dd"
             dateFormatter.dateFormat = "YYYY-MM-dd"
             let expirationTime = dateFormatter.string(from: date)
             let expirationTime = dateFormatter.string(from: date)
-            //networking?.updateShare(idRemoteShared: tableShare.idRemoteShared, password: nil, permission: 0, note: nil, expirationTime: expirationTime, hideDownload: tableShare.hideDownload)
+            
+            networking?.updateShare(idShare: tableShare.idShare, password: nil, permission: 0, note: nil, expirationTime: expirationTime, hideDownload: tableShare.hideDownload)
         }
         }
     }
     }