marinofaggiana 5 жил өмнө
parent
commit
acef9a8e6e

+ 3 - 3
iOSClient/Library/OCCommunicationLib/OCCommunication.m

@@ -3208,9 +3208,9 @@
         NSData *responseData = (NSData*) response;
         
         //Parse
-        NSError *error;
-        NSDictionary *jsongParsed = [NSJSONSerialization JSONObjectWithData:responseData options:NSJSONReadingMutableContainers error:&error];
-        NSLog(@"[LOG] URL Asset : %@",jsongParsed);
+        //NSError *error;
+        //NSDictionary *jsongParsed = [NSJSONSerialization JSONObjectWithData:responseData options:NSJSONReadingMutableContainers error:&error];
+        //NSLog(@"[LOG] URL Asset : %@",jsongParsed);
 
         successRequest(response, nil, request.redirectedServer);
         

+ 8 - 1
iOSClient/Library/OCCommunicationLib/OCWebDavClient/OCWebDAVClient.m

@@ -1487,11 +1487,18 @@ NSString const *OCWebDAVModificationDateKey	= @"modificationdate";
     
     NSParameterAssert(success);
     
-    _requestMethod = @"GET";
+    _requestMethod = @"PROPFIND";
     
     NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
     [request setValue:@"true" forHTTPHeaderField:@"OCS-APIRequest"];
     
+    [request setHTTPBody:[@"<?xml version=\"1.0\" encoding=\"UTF-8\"?><D:propfind xmlns:D=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\" xmlns:nc=\"http://nextcloud.org/ns\">"
+                         "<D:prop>"
+                         "<D:actorId/>"
+                         "</D:prop>"
+                         "</D:propfind>" dataUsingEncoding:NSUTF8StringEncoding]];
+    [request setValue:@"application/xml" forHTTPHeaderField:@"Content-Type"];
+    
     OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
     [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
     

+ 1 - 1
iOSClient/Main/CCMain.m

@@ -1882,7 +1882,7 @@
 #ifdef DEBUG
 
     UINavigationController *shareNavigationController = [[UIStoryboard storyboardWithName:@"NCShare" bundle:nil] instantiateInitialViewController];
-    NCShare *shareViewController = (NCShare *)shareNavigationController.topViewController;
+    NCSharePaging *shareViewController = (NCSharePaging *)shareNavigationController.topViewController;
     
     shareViewController.metadata = metadata;
     shareViewController.shareLink = [appDelegate.sharesLink objectForKey:metadata.fileID];

+ 6 - 6
iOSClient/Share/NCShare.storyboard

@@ -10,10 +10,10 @@
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <scenes>
-        <!--Share-->
+        <!--Share Paging-->
         <scene sceneID="ipe-g4-f5a">
             <objects>
-                <viewController id="UdT-J4-zvv" customClass="NCShare" customModule="Nextcloud" customModuleProvider="target" sceneMemberID="viewController">
+                <viewController id="UdT-J4-zvv" customClass="NCSharePaging" customModule="Nextcloud" customModuleProvider="target" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="xka-e7-U7G">
                         <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -57,12 +57,12 @@
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="l4G-HZ-s1x" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="1032" y="528"/>
+            <point key="canvasLocation" x="2236" y="-388"/>
         </scene>
-        <!--View Controller-->
+        <!--Share-->
         <scene sceneID="Iqh-6B-MEV">
             <objects>
-                <viewController storyboardIdentifier="sharing" id="bgO-Rz-2M1" sceneMemberID="viewController">
+                <viewController storyboardIdentifier="sharing" id="bgO-Rz-2M1" customClass="NCShare" customModule="Nextcloud" customModuleProvider="target" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="aV2-U6-JTf">
                         <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -72,7 +72,7 @@
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="4Te-U6-4XT" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="1720" y="528"/>
+            <point key="canvasLocation" x="2235" y="404"/>
         </scene>
     </scenes>
 </document>

+ 17 - 2
iOSClient/Share/NCShare.swift

@@ -24,7 +24,7 @@
 import Foundation
 import Parchment
 
-class NCShare: UIViewController {
+class NCSharePaging: UIViewController {
     
     private let pagingViewController = NCShareHeaderViewController()
     
@@ -74,7 +74,7 @@ class NCShare: UIViewController {
     }
 }
 
-extension NCShare: PagingViewControllerDataSource {
+extension NCSharePaging: PagingViewControllerDataSource {
     
     func pagingViewController<T>(_ pagingViewController: PagingViewController<T>, viewControllerForIndex index: Int) -> UIViewController {
         
@@ -209,6 +209,8 @@ class NCShareHeaderView: UIView {
     @IBOutlet weak var favorite: UIButton!
 }
 
+// MARK: - Comments
+
 class NCShareComments: UIViewController {
     
     var metadata: tableMetadata?
@@ -222,3 +224,16 @@ class NCShareComments: UIViewController {
         })
     }
 }
+
+// MARK: - Share
+
+class NCShare: UIViewController {
+    
+    var metadata: tableMetadata?
+    private let appDelegate = UIApplication.shared.delegate as! AppDelegate
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        
+    }
+}