1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-13 03:02:22 -05:00

Caldav: return reoccuring events on time-range request

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1355 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-08-17 15:10:19 +00:00
parent 57a379c67b
commit 9353e2bc63
2 changed files with 21 additions and 24 deletions

View File

@ -2239,8 +2239,7 @@ public abstract class ExchangeSession {
if (timeRangeEnd != null) {
andCondition.add(lte("dtend", formatSearchDate(parser.parse(timeRangeEnd))));
}
andCondition.add(isEqualTo("instancetype", 0));
return searchEvents(folderPath, ITEM_PROPERTIES, andCondition);
return searchEvents(folderPath, andCondition);
} catch (ParseException e) {
throw new IOException(e);
}

View File

@ -137,6 +137,7 @@ public class TestCaldav extends AbstractDavMailTestCase {
buffer.append("<C:comp-filter name=\"VCALENDAR\">");
buffer.append("<C:comp-filter name=\"VEVENT\">");
buffer.append("<C:time-range start=\"").append(formatter.format(start)).append("\" end=\"").append(formatter.format(end)).append("\"/>");
//buffer.append("<C:time-range start=\"").append(formatter.format(start)).append("\"/>");
buffer.append("</C:comp-filter>");
buffer.append("</C:comp-filter>");
buffer.append("<C:filter>");
@ -150,14 +151,11 @@ public class TestCaldav extends AbstractDavMailTestCase {
Set<String> ITEM_PROPERTIES = new HashSet<String>();
ITEM_PROPERTIES.add("instancetype");
List<ExchangeSession.Event> events = session.searchEvents("/users/" + session.getEmail() + "/calendar/", ITEM_PROPERTIES,
session.and(
List<ExchangeSession.Event> events = session.searchEvents("/users/" + session.getEmail() + "/calendar/",
session.and(
session.gt("dtstart", session.formatSearchDate(start)),
session.lt("dtend", session.formatSearchDate(end))
)
, session.or(session.isEqualTo("instancetype", 1), session.isEqualTo("instancetype", 0))
)
);
assertEquals(events.size(), responses.length);