Commit 4e936d9e authored by Mickaël Guessant's avatar Mickaël Guessant

Caldav: EWS refactoring, implement free/busy status conversion

git-svn-id: https://svn.code.sf.net/p/davmail/code/trunk@2514 3d1905a2-6b24-0410-a738-b14d5a86fcbd
parent fd16736a
......@@ -1579,6 +1579,19 @@ public class EwsExchangeSession extends ExchangeSession {
}
updates.add(Field.createFieldUpdate("itemsensitivity", eventClass));
// Convert busy status
String status = vCalendar.getFirstVeventPropertyValue("STATUS");
if ("TENTATIVE".equals(status)) {
status = "Tentative";
} else if ("CANCELLED".equals(status)){
status = "Free";
} else {
// CONFIRMED
status = "Busy";
}
updates.add(Field.createFieldUpdate("busystatus", status));
updates.add(Field.createFieldUpdate("description", vCalendar.getFirstVeventPropertyValue("DESCRIPTION")));
updates.add(Field.createFieldUpdate("location", vCalendar.getFirstVeventPropertyValue("LOCATION")));
// Collect categories on multiple lines
......@@ -2030,6 +2043,10 @@ public class EwsExchangeSession extends ExchangeSession {
// LAST-MODIFIED is missing in event content
localVCalendar.setFirstVeventPropertyValue("LAST-MODIFIED", convertDateFromExchange(getItemMethod.getResponseItem().get(Field.get("lastmodified").getResponseName())));
if ("FREE".equals(localVCalendar.getFirstVeventPropertyValue("X-MICROSOFT-CDO-BUSYSTATUS"))) {
localVCalendar.setFirstVeventPropertyValue("STATUS", "CANCELLED");
}
// restore mozilla invitations option
localVCalendar.setFirstVeventPropertyValue("X-MOZ-SEND-INVITATIONS",
getItemMethod.getResponseItem().get(Field.get("xmozsendinvitations").getResponseName()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment