Marino Faggiana 6 年之前
父節點
當前提交
a093253331
共有 1 個文件被更改,包括 10 次插入2 次删除
  1. 10 2
      iOSClient/Library/OCCommunicationLib/OCWebDavClient/OCWebDAVClient.m

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

@@ -271,7 +271,7 @@ NSString const *OCWebDAVModificationDateKey	= @"modificationdate";
     NSString *body = @"";
     NSString *whereType = @"";
     NSString *whereDate = @"";
-        
+    
     NSParameterAssert(success);
     
     _requestMethod = @"SEARCH";
@@ -280,6 +280,14 @@ NSString const *OCWebDAVModificationDateKey	= @"modificationdate";
     
     if (contentType && dateLastModified) {
         
+        NSString *operator = @"";
+
+        if (dateLastModified.count == 1) {
+            operator = @"gte";
+        } else {
+            operator = @"eq";
+        }
+        
         body = [NSString stringWithFormat: @""
         "<?xml version=\"1.0\"?>"
         "<d:searchrequest xmlns:d=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\" xmlns:nc=\"http://nextcloud.org/ns\">"
@@ -315,7 +323,7 @@ NSString const *OCWebDAVModificationDateKey	= @"modificationdate";
         body = [NSString stringWithFormat: @"%@%@</d:or><d:or>", body, whereType];
         
         for (NSString *date in dateLastModified) {
-            whereDate = [NSString stringWithFormat: @"%@<d:gte><d:prop><d:getlastmodified/></d:prop><d:literal>%@</d:literal></d:gte>", whereDate, date];
+            whereDate = [NSString stringWithFormat: @"%@<d:%@><d:prop><d:getlastmodified/></d:prop><d:literal>%@</d:literal></d:%@>", whereDate, operator, date, operator];
         }
         
         body = [NSString stringWithFormat: @"%@%@</d:or></d:and></d:where></d:basicsearch></d:searchrequest>", body, whereDate];