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

+ 57 - 52
iOSClient/Library/OCCommunicationLib/OCWebDavClient/OCWebDAVClient.m

@@ -421,60 +421,65 @@ NSString const *OCWebDAVModificationDateKey	= @"modificationdate";
     body = [NSString stringWithFormat: @""
             "<?xml version=\"1.0\"?>"
                 "<d:searchrequest xmlns:d=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\" xmlns:nc=\"http://nextcloud.org/ns\">"
-                "<d:basicsearch>"
-                    "<d:select>"
-                        "<d:prop>"
-                            "<d:getlastmodified />"
-                            "<d:getetag />"
-                            "<d:getcontenttype />"
-                            "<d:resourcetype/>"
-                            "<d:getcontentlength />"
-                            "<oc:fileid/>"
-                            "<oc:id/>"
-                            "<oc:permissions />"
-                            "<oc:size />"
-                            "<oc:favorite/>"
-                            "<nc:is-encrypted/>"
-                            "<nc:has-preview/>"
-                        "</d:prop>"
-                    "</d:select>"
-                    "<d:from>"
-                        "<d:scope>"
-                            "<d:href>/files/%@%@</d:href>"
-                            "<d:depth>1</d:depth>"
-                        "</d:scope>"
-                    "</d:from>"
-                    "<d:orderby>"
-                        "<d:order>"
-                            "<d:prop><d:displayname/></d:prop>"
-                            "<d:descending/>"
-                        "</d:order>"
-                        "<d:order>"
-                            "<d:prop><d:getlastmodified/></d:prop>"
-                            "<d:descending/>"
-                        "</d:order>"
-                    "</d:orderby>"
+                    "<d:basicsearch>"
+                        "<d:select>"
+                            "<d:prop>"
+                                "<d:getlastmodified/>"
+                                "<d:getetag/>"
+                                "<d:getcontenttype/>"
+                                "<d:resourcetype/>"
+                                "<d:getcontentlength/>"
+                                "<oc:fileid/>"
+                                "<oc:id/>"
+                                "<oc:permissions/>"
+                                "<oc:size/>"
+                                "<oc:favorite/>"
+                                "<nc:is-encrypted/>"
+                                "<nc:has-preview/>"
+                            "</d:prop>"
+                        "</d:select>"
             
-                    "<d:where>"
-                        "<d:like>"
-                            "<d:prop><d:displayname/></d:prop>"
-                            "<d:literal>%@</d:literal>"
-                        "</d:like>"
-                    "</d:where>"
-            /*
-                    "<d:where><d:and><d:or>"
-                        "<d:gte>"
-                            "<d:prop><d:getlastmodified/></d:prop>"
-                            "<d:literal>%@</d:literal>"
-                        "</d:gte>"
-                    "</d:or></d:and></d:where>"
-            */
-                    "<d:limit>"
-                        "<d:nresults>%@</d:nresults>"
-                    "</d:limit>"
-                "</d:basicsearch>"
+                        "<d:from>"
+                            "<d:scope>"
+                                "<d:href>/files/%@%@</d:href>"
+                                "<d:depth>1</d:depth>"
+                            "</d:scope>"
+                        "</d:from>"
+            
+                        /*
+                        "<d:orderby>"
+                            "<d:order>"
+                                "<d:prop><d:displayname/></d:prop>"
+                                "<d:descending/>"
+                            "</d:order>"
+                            "<d:order>"
+                                "<d:prop><d:getlastmodified/></d:prop>"
+                                "<d:descending/>"
+                            "</d:order>"
+                        "</d:orderby>"
+                        */
+            
+                        "<d:where>"
+                            "<d:like>"
+                                "<d:prop><d:displayname/></d:prop>"
+                                "<d:literal>%@</d:literal>"
+                            "</d:like>"
+                        "</d:where>"
+                /*
+                        "<d:where><d:and><d:or>"
+                            "<d:gte>"
+                                "<d:prop><d:getlastmodified/></d:prop>"
+                                "<d:literal>%@</d:literal>"
+                            "</d:gte>"
+                        "</d:or></d:and></d:where>"
+               
+                        "<d:limit>"
+                            "<d:nresults>%@</d:nresults>"
+                        "</d:limit>"
+                 */
+                    "</d:basicsearch>"
                 "</d:searchrequest>"
-    ,userID, folder, fileName, [@(numberOfItem) stringValue]];
+            ,userID, folder, fileName]; //, [@(numberOfItem) stringValue]];
     
     [request setHTTPBody:[body dataUsingEncoding:NSUTF8StringEncoding]];
     [request setValue:@"text/xml" forHTTPHeaderField:@"Content-Type"];