marinofaggiana 4 年之前
父节点
当前提交
43cf69b7a2
共有 2 个文件被更改,包括 13 次插入6 次删除
  1. 8 1
      iOSClient/Share/NCShare.swift
  2. 5 5
      iOSClient/Share/NCShareCommon.swift

+ 8 - 1
iOSClient/Share/NCShare.swift

@@ -149,6 +149,10 @@ class NCShare: UIViewController, UIGestureRecognizerDelegate, NCShareLinkCellDel
     @IBAction func touchUpInsideButtonCopyInernalLink(_ sender: Any) {
         
         guard let metadata = self.metadata else { return }
+        
+        let internalLink = appDelegate.activeUrl + "/index.php/f/" + metadata.fileId
+        
+        NCShareCommon.sharedInstance.copyLink(link: internalLink, viewController: self, sender: sender)
     }
     
     @IBAction func touchUpInsideButtonMenu(_ sender: Any) {
@@ -198,7 +202,10 @@ class NCShare: UIViewController, UIGestureRecognizerDelegate, NCShareLinkCellDel
     }
     
     func tapCopy(with tableShare: tableShare?, sender: Any) {
-        NCShareCommon.sharedInstance.copyLink(tableShare: tableShare, viewController: self, sender: sender)
+        
+        if let link = tableShare?.url {
+            NCShareCommon.sharedInstance.copyLink(link: link, viewController: self, sender: sender)
+        }
     }
     
     func switchCanEdit(with tableShare: tableShare?, switch: Bool, sender: UISwitch) {

+ 5 - 5
iOSClient/Share/NCShareCommon.swift

@@ -185,11 +185,11 @@ class NCShareCommon: NSObject {
         return(calendarView: calendar, viewWindow: viewWindow)
     }
     
-    func copyLink(tableShare: tableShare?, viewController: UIViewController, sender: Any) {
-        guard let tableShare = tableShare else { return }
+    func copyLink(link: String, viewController: UIViewController, sender: Any) {
+        //guard let tableShare = tableShare else { return }
         
-        if let name = URL(string: tableShare.url), !name.absoluteString.isEmpty {
-            let objectsToShare = [name]
+        //if let name = URL(string: tableShare.url), !name.absoluteString.isEmpty {
+            let objectsToShare = [link]
             
             let activityViewController = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil)
             
@@ -201,7 +201,7 @@ class NCShareCommon: NSObject {
             }
             
             viewController.present(activityViewController, animated: true, completion: nil)
-        }
+        //}
     }
     
     func getImageShareType(shareType: Int) -> UIImage? {