Partial fix for missing items on Exchange 2010

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2010 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2012-08-30 22:16:58 +00:00
parent fd3e99862e
commit bc0c0b5b40
2 changed files with 25 additions and 15 deletions

View File

@ -212,6 +212,7 @@ public class VCalendar extends VObject {
if (isCdoAllDay(vObject)) {
setClientAllday(vObject.getProperty("DTSTART"));
setClientAllday(vObject.getProperty("DTEND"));
setClientAllday(vObject.getProperty("RECURRENCE-ID"));
}
String cdoBusyStatus = vObject.getPropertyValue("X-MICROSOFT-CDO-BUSYSTATUS");
if (cdoBusyStatus != null) {

View File

@ -1322,7 +1322,7 @@ public class EwsExchangeSession extends ExchangeSession {
String instancetype = response.get(Field.get("instancetype").getResponseName());
boolean isrecurring = "true".equals(response.get(Field.get("isrecurring").getResponseName()));
String calendaritemtype = response.get(Field.get("calendaritemtype").getResponseName());
isException = "3".equals(instancetype) || (isrecurring && "Single".equals(calendaritemtype));
isException = "3".equals(instancetype);
}
/**
@ -1643,13 +1643,17 @@ public class EwsExchangeSession extends ExchangeSession {
content = getICS(new SharedByteArrayInputStream(content));
}
VCalendar localVCalendar = new VCalendar(content, email, getVTimezone());
// remove additional reminder
if (!"true".equals(getItemMethod.getResponseItem().get(Field.get("reminderset").getResponseName()))) {
localVCalendar.removeVAlarm();
}
String calendaruid = getItemMethod.getResponseItem().get(Field.get("calendaruid").getResponseName());
if (calendaruid != null) {
localVCalendar.setFirstVeventPropertyValue("UID", calendaruid);
if ("Exchange2007_SP1".equals(serverVersion)) {
// remove additional reminder
if (!"true".equals(getItemMethod.getResponseItem().get(Field.get("reminderset").getResponseName()))) {
localVCalendar.removeVAlarm();
}
if (calendaruid != null) {
localVCalendar.setFirstVeventPropertyValue("UID", calendaruid);
}
}
List<EWSMethod.Attendee> attendees = getItemMethod.getResponseItem().getAttendees();
if (attendees != null) {
@ -1674,14 +1678,19 @@ public class EwsExchangeSession extends ExchangeSession {
for (EWSMethod.Occurrence occurrence : occurences) {
if (modifiedOccurrencesIterator.hasNext()) {
VObject modifiedOccurrence = modifiedOccurrencesIterator.next();
// fix uid, should be the same as main VEVENT
if (calendaruid != null) {
modifiedOccurrence.setPropertyValue("UID", calendaruid);
}
VProperty recurrenceId = modifiedOccurrence.getProperty("RECURRENCE-ID");
if (recurrenceId != null) {
recurrenceId.removeParam("TZID");
recurrenceId.getValues().set(0, convertDateFromExchange(occurrence.originalStart));
// TODO: fix modified occurences attendees
if ("Exchange2007_SP1".equals(serverVersion)) {
// fix uid, should be the same as main VEVENT
if (calendaruid != null) {
modifiedOccurrence.setPropertyValue("UID", calendaruid);
}
VProperty recurrenceId = modifiedOccurrence.getProperty("RECURRENCE-ID");
if (recurrenceId != null) {
recurrenceId.removeParam("TZID");
recurrenceId.getValues().set(0, convertDateFromExchange(occurrence.originalStart));
}
}
}
}