Browse Source

Using URL's returned from the server for sharing

Doing this so the app makes use of pretty URL's without index.php

Signed-off-by: Jamie White <jamie@consolegfx.net>
Jamie White 6 years ago
parent
commit
38c97dc2cd

+ 1 - 0
iOSClient/Library/OCCommunicationLib/OCSharedDto.h

@@ -51,6 +51,7 @@ typedef enum {
 @property (nonatomic, copy) NSString *token;
 @property NSInteger storage;
 @property NSInteger mailSend;
+@property (nonatomic, copy) NSString *url;
 @property (nonatomic, copy) NSString *uidOwner;
 @property (nonatomic, copy) NSString *shareWithDisplayName;
 @property (nonatomic, copy) NSString *displayNameOwner;

+ 4 - 0
iOSClient/Library/OCCommunicationLib/OCWebDavClient/Parsers/OCXMLSharedParser.m

@@ -211,6 +211,10 @@
         
         _currentShared.displayNameFileOwner = _xmlChars;
         
+    } else if ([elementName isEqualToString:@"url"]) {
+        
+        _currentShared.url = _xmlChars;
+        
     } else if ([elementName isEqualToString:@"mimetype"]) {
         
         _currentShared.mimeType = _xmlChars;

+ 4 - 0
iOSClient/Share/CCShareOC.m

@@ -337,6 +337,10 @@
         
         url = sharedLink;
         
+    } else if (self.itemShareLink.url) {
+        
+        url = self.itemShareLink.url;
+        
     } else {
 
         url = [NSString stringWithFormat:@"%@/%@%@", appDelegate.activeUrl, k_share_link_middle_part_url_after_version_8, sharedLink];