mirror of
https://github.com/moparisthebest/davmail
synced 2025-02-28 09:21:49 -05:00
Caldav: drop davmail.caldavDisableTasks setting, retrieve only events from calendar
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1864 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
c39767dfbc
commit
bdb1546e6a
@ -2518,8 +2518,7 @@ public abstract class ExchangeSession {
|
||||
* @throws IOException on error
|
||||
*/
|
||||
public List<Event> getAllEvents(String folderPath) throws IOException {
|
||||
boolean caldavDisableTasks = Settings.getBooleanProperty("davmail.caldavDisableTasks");
|
||||
List<Event> results = searchEvents(folderPath, getCalendarItemCondition(caldavDisableTasks, getPastDelayCondition("dtstart")));
|
||||
List<Event> results = searchEvents(folderPath, getCalendarItemCondition(getPastDelayCondition("dtstart")));
|
||||
|
||||
if (isMainCalendar(folderPath)) {
|
||||
// retrieve tasks from main tasks folder
|
||||
@ -2529,7 +2528,7 @@ public abstract class ExchangeSession {
|
||||
return results;
|
||||
}
|
||||
|
||||
protected abstract Condition getCalendarItemCondition(boolean excludeTasks, Condition dateCondition);
|
||||
protected abstract Condition getCalendarItemCondition(Condition dateCondition);
|
||||
|
||||
protected Condition getPastDelayCondition(String attribute) {
|
||||
int caldavPastDelay = Settings.getIntProperty("davmail.caldavPastDelay");
|
||||
@ -2569,8 +2568,7 @@ public abstract class ExchangeSession {
|
||||
*/
|
||||
public List<Event> searchEvents(String folderPath, String timeRangeStart, String timeRangeEnd) throws IOException {
|
||||
Condition dateCondition = getRangeCondition(timeRangeStart, timeRangeEnd);
|
||||
boolean caldavDisableTasks = Settings.getBooleanProperty("davmail.caldavDisableTasks");
|
||||
Condition condition = getCalendarItemCondition(caldavDisableTasks, dateCondition);
|
||||
Condition condition = getCalendarItemCondition(dateCondition);
|
||||
|
||||
return searchEvents(folderPath, condition);
|
||||
}
|
||||
@ -2586,7 +2584,7 @@ public abstract class ExchangeSession {
|
||||
*/
|
||||
public List<Event> searchEventsOnly(String folderPath, String timeRangeStart, String timeRangeEnd) throws IOException {
|
||||
Condition dateCondition = getRangeCondition(timeRangeStart, timeRangeEnd);
|
||||
return searchEvents(folderPath, getCalendarItemCondition(true, dateCondition));
|
||||
return searchEvents(folderPath, getCalendarItemCondition(dateCondition));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2098,16 +2098,11 @@ public class DavExchangeSession extends ExchangeSession {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Condition getCalendarItemCondition(boolean excludeTasks, Condition dateCondition) {
|
||||
protected Condition getCalendarItemCondition(Condition dateCondition) {
|
||||
// instancetype 0 single appointment / 1 master recurring appointment
|
||||
if (excludeTasks) {
|
||||
return or(isEqualTo("instancetype", 1),
|
||||
and(isEqualTo("instancetype", 0), dateCondition));
|
||||
} else {
|
||||
return or(isNull("instancetype"),
|
||||
isEqualTo("instancetype", 1),
|
||||
and(isEqualTo("instancetype", 0), dateCondition));
|
||||
}
|
||||
return and(isEqualTo("outlookmessageclass", "IPM.Appointment"),
|
||||
or(isEqualTo("instancetype", 1),
|
||||
and(isEqualTo("instancetype", 0), dateCondition)));
|
||||
}
|
||||
|
||||
protected MultiStatusResponse[] searchItems(String folderPath, Set<String> attributes, Condition condition,
|
||||
|
@ -1576,7 +1576,7 @@ public class EwsExchangeSession extends ExchangeSession {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Condition getCalendarItemCondition(boolean excludeTasks, Condition dateCondition) {
|
||||
protected Condition getCalendarItemCondition(Condition dateCondition) {
|
||||
// tasks in calendar not supported over EWS => do not look for instancetype null
|
||||
return or(
|
||||
// Exchange 2010
|
||||
|
Loading…
x
Reference in New Issue
Block a user