Marino Faggiana 6 år sedan
förälder
incheckning
cb7a6f034a

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

@@ -51,5 +51,6 @@
 @property (nonatomic, copy) NSString *trashbinFileName;
 @property (nonatomic, copy) NSString *trashbinOriginalLocation;
 @property long trashbinDeletionTime;
+@property BOOL hasPreview;
 
 @end

+ 5 - 2
iOSClient/Library/OCCommunicationLib/OCWebDavClient/OCWebDAVClient.m

@@ -217,7 +217,7 @@ NSString const *OCWebDAVModificationDateKey	= @"modificationdate";
 	NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:path parameters:nil timeout:k_timeout_webdav];
     
     [request setValue: depth forHTTPHeaderField: @"Depth"];
-    [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:resourcetype/><D:getlastmodified/><size xmlns=\"http://owncloud.org/ns\"/><favorite xmlns=\"http://owncloud.org/ns\"/><id xmlns=\"http://owncloud.org/ns\"/><D:getcontentlength/><D:getetag/><permissions xmlns=\"http://owncloud.org/ns\"/><D:getcontenttype/><nc:is-encrypted/></D:prop></D:propfind>" dataUsingEncoding:NSUTF8StringEncoding]];
+    [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:resourcetype/><D:getlastmodified/><size xmlns=\"http://owncloud.org/ns\"/><favorite xmlns=\"http://owncloud.org/ns\"/><id xmlns=\"http://owncloud.org/ns\"/><D:getcontentlength/><D:getetag/><permissions xmlns=\"http://owncloud.org/ns\"/><D:getcontenttype/><nc:is-encrypted/><nc:has-preview/></D:prop></D:propfind>" dataUsingEncoding:NSUTF8StringEncoding]];
     [request setValue:@"application/xml" forHTTPHeaderField:@"Content-Type"];
     
     
@@ -236,7 +236,7 @@ NSString const *OCWebDAVModificationDateKey	= @"modificationdate";
     NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:path parameters:nil timeout:k_timeout_webdav];
     
     [request setValue: depth forHTTPHeaderField: @"Depth"];
-    [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:resourcetype/><D:getlastmodified/><size xmlns=\"http://owncloud.org/ns\"/><favorite xmlns=\"http://owncloud.org/ns\"/><id xmlns=\"http://owncloud.org/ns\"/><D:getcontentlength/><D:getetag/><permissions xmlns=\"http://owncloud.org/ns\"/><D:getcontenttype/><nc:is-encrypted/></D:prop></D:propfind>" dataUsingEncoding:NSUTF8StringEncoding]];
+    [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:resourcetype/><D:getlastmodified/><size xmlns=\"http://owncloud.org/ns\"/><favorite xmlns=\"http://owncloud.org/ns\"/><id xmlns=\"http://owncloud.org/ns\"/><D:getcontentlength/><D:getetag/><permissions xmlns=\"http://owncloud.org/ns\"/><D:getcontenttype/><nc:is-encrypted/><nc:has-preview/></D:prop></D:propfind>" dataUsingEncoding:NSUTF8StringEncoding]];
     [request setValue:@"application/xml" forHTTPHeaderField:@"Content-Type"];
     
     
@@ -296,6 +296,7 @@ NSString const *OCWebDAVModificationDateKey	= @"modificationdate";
                         "<oc:size />"
                         "<oc:favorite/>"
                         "<nc:is-encrypted/>"
+                        "<nc:has-preview/>"
                     "</d:prop>"
                 "</d:select>"
                 "<d:from>"
@@ -331,6 +332,7 @@ NSString const *OCWebDAVModificationDateKey	= @"modificationdate";
                         "<oc:size />"
                         "<oc:favorite/>"
                         "<nc:is-encrypted/>"
+                        "<nc:has-preview/>"
                     "</d:prop>"
                 "</d:select>"
                 "<d:from>"
@@ -410,6 +412,7 @@ NSString const *OCWebDAVModificationDateKey	= @"modificationdate";
                     "<oc:permissions/>"
                     "<oc:favorite/>"
                     "<nc:is-encrypted/>"
+                    "<nc:has-preview/>"
                 "</d:prop>"
                 "<oc:filter-rules>"
                     "<oc:favorite>1</oc:favorite>"

+ 2 - 0
iOSClient/Library/OCCommunicationLib/OCWebDavClient/Parsers/OCXMLListParser.m

@@ -201,6 +201,8 @@
         _currentFile.trashbinOriginalLocation = _xmlChars;
     }else if ([elementName isEqualToString:@"nc:trashbin-deletion-time"]) {
         _currentFile.trashbinDeletionTime = (long)[_xmlChars longLongValue];
+    }else if ([elementName isEqualToString:@"nc:has-preview"]) {
+        _currentFile.hasPreview = [_xmlChars boolValue];
     }
 }
 

+ 2 - 0
iOSClient/Library/OCCommunicationLib/OCWebDavClient/Parsers/OCXMLParser.m

@@ -245,6 +245,8 @@ NSString *OCCWebDAVURIKey           = @"uri";
         _currentFile.trashbinOriginalLocation = _xmlChars;
     }else if ([elementName isEqualToString:@"nc:trashbin-deletion-time"]) {
         _currentFile.trashbinDeletionTime = (long)[_xmlChars longLongValue];
+    } else if ([elementName isEqualToString:@"nc:has-preview"]) {
+        _currentFile.hasPreview = [_xmlChars boolValue];
     }
 }