1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-14 11:42:23 -05:00

EWS: store X-MOZ-SEND-INVITATIONS property to fix no notification issue with Lightning

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1584 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-12-26 11:46:11 +00:00
parent 1615f4991b
commit f8823f36a6
2 changed files with 15 additions and 2 deletions

View File

@ -1191,6 +1191,11 @@ public class EwsExchangeSession extends ExchangeSession {
} else {
updates.add(Field.createFieldUpdate("apptstateflags", "0"));
}
// store mozilla invitations option
String xMozSendInvitations = vCalendar.getFirstVeventPropertyValue("X-MOZ-SEND-INVITATIONS");
if (xMozSendInvitations != null) {
updates.add(Field.createFieldUpdate("xmozsendinvitations", xMozSendInvitations));
}
// handle mozilla alarm
String xMozLastack = vCalendar.getFirstVeventPropertyValue("X-MOZ-LASTACK");
if (xMozLastack != null) {
@ -1270,6 +1275,7 @@ public class EwsExchangeSession extends ExchangeSession {
getItemMethod.addAdditionalProperty(Field.get("optionalattendees"));
getItemMethod.addAdditionalProperty(Field.get("xmozlastack"));
getItemMethod.addAdditionalProperty(Field.get("xmozsnoozetime"));
getItemMethod.addAdditionalProperty(Field.get("xmozsendinvitations"));
}
executeMethod(getItemMethod);
@ -1292,15 +1298,21 @@ public class EwsExchangeSession extends ExchangeSession {
VProperty attendeeProperty = new VProperty("ATTENDEE", "mailto:" + attendee.email);
attendeeProperty.addParam("CN", attendee.name);
attendeeProperty.addParam("PARTSTAT", attendee.partstat);
//attendeeProperty.addParam("RSVP", "TRUE");
attendeeProperty.addParam("ROLE", attendee.role);
localVCalendar.addFirstVeventProperty(attendeeProperty);
}
}
// restore mozilla invitations option
localVCalendar.setFirstVeventPropertyValue("X-MOZ-SEND-INVITATIONS",
getItemMethod.getResponseItem().get(Field.get("xmozsendinvitations").getResponseName()));
// restore mozilla alarm status
localVCalendar.setFirstVeventPropertyValue("X-MOZ-LASTACK",
getItemMethod.getResponseItem().get(Field.get("xmozlastack").getResponseName()));
localVCalendar.setFirstVeventPropertyValue("X-MOZ-SNOOZE-TIME",
getItemMethod.getResponseItem().get(Field.get("xmozsnoozetime").getResponseName()));
// overwrite method
// localVCalendar.setPropertyValue("METHOD", "REQUEST");
content = localVCalendar.toString().getBytes("UTF-8");
} catch (IOException e) {
@ -1575,7 +1587,7 @@ public class EwsExchangeSession extends ExchangeSession {
} else {
int end = line.lastIndexOf("\" selected>");
int start = line.lastIndexOf('\"', end - 1);
result = line.substring(start+1, end);
result = line.substring(start + 1, end);
}
}
} catch (IOException e) {

View File

@ -200,6 +200,7 @@ public final class Field {
FIELD_MAP.put("xmozlastack", new ExtendedFieldURI(ExtendedFieldURI.DistinguishedPropertySetType.PublicStrings, "xmozlastack"));
FIELD_MAP.put("xmozsnoozetime", new ExtendedFieldURI(ExtendedFieldURI.DistinguishedPropertySetType.PublicStrings, "xmozsnoozetime"));
FIELD_MAP.put("xmozsendinvitations", new ExtendedFieldURI(ExtendedFieldURI.DistinguishedPropertySetType.PublicStrings, "xmozsendinvitations"));
// attachments
FIELD_MAP.put("attachments", new UnindexedFieldURI("item:Attachments"));