EWS: fix 3263905 ErrorInvalidPropertyRequest, do not update message:IsRead on appointments

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1957 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2012-05-10 22:08:22 +00:00
parent 8a8e8f1a6c
commit 7d6ee0d27e
1 changed files with 24 additions and 18 deletions

View File

@ -437,12 +437,17 @@ public class EwsExchangeSession extends ExchangeSession {
@Override @Override
public void updateMessage(ExchangeSession.Message message, Map<String, String> properties) throws IOException { public void updateMessage(ExchangeSession.Message message, Map<String, String> properties) throws IOException {
if (properties.containsKey("read") && "urn:content-classes:appointment".equals(message.contentClass)) {
properties.remove("read");
}
if (!properties.isEmpty()) {
UpdateItemMethod updateItemMethod = new UpdateItemMethod(MessageDisposition.SaveOnly, UpdateItemMethod updateItemMethod = new UpdateItemMethod(MessageDisposition.SaveOnly,
ConflictResolution.AlwaysOverwrite, ConflictResolution.AlwaysOverwrite,
SendMeetingInvitationsOrCancellations.SendToNone, SendMeetingInvitationsOrCancellations.SendToNone,
((EwsExchangeSession.Message) message).itemId, buildProperties(properties)); ((EwsExchangeSession.Message) message).itemId, buildProperties(properties));
executeMethod(updateItemMethod); executeMethod(updateItemMethod);
} }
}
@Override @Override
public void deleteMessage(ExchangeSession.Message message) throws IOException { public void deleteMessage(ExchangeSession.Message message) throws IOException {
@ -1726,6 +1731,7 @@ public class EwsExchangeSession extends ExchangeSession {
* Common item properties * Common item properties
*/ */
protected static final Set<String> ITEM_PROPERTIES = new HashSet<String>(); protected static final Set<String> ITEM_PROPERTIES = new HashSet<String>();
static { static {
ITEM_PROPERTIES.add("etag"); ITEM_PROPERTIES.add("etag");
ITEM_PROPERTIES.add("displayname"); ITEM_PROPERTIES.add("displayname");