[evolution-ews] Exchange 2007SP1 introduced <ReadFlagChange> which is basically identical to <Update>; add read flag



commit a30d1af675a6a36751df43469b6fe9c3280394a9
Author: Pavel Ocheretny <pocheretny src gnome org>
Date:   Mon Aug 8 15:54:01 2011 +0300

    Exchange 2007SP1 introduced <ReadFlagChange> which is basically identical to <Update>;
    add read flag changed items to updated items list.

 src/server/e-ews-connection.c |   10 ++++++++++
 src/server/e-ews-item.c       |    6 ++++++
 2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/server/e-ews-connection.c b/src/server/e-ews-connection.c
index a76ba14..d3d4a8f 100644
--- a/src/server/e-ews-connection.c
+++ b/src/server/e-ews-connection.c
@@ -513,6 +513,16 @@ sync_xxx_response_cb (ESoapParameter *subparam, EwsNode *enode, ItemParser parse
 			folder = parser (subparam1);
 			items_updated = g_slist_append (items_updated, folder);
 		}
+		  /* Exchange 2007SP1 introduced <ReadFlagChange> which is basically identical
+		   * to <Update>; no idea why they thought it was a good idea. */
+		for (subparam1 = e_soap_parameter_get_first_child_by_name (node, "ReadFlagChange");
+		     subparam1 != NULL;
+		     subparam1 = e_soap_parameter_get_next_child_by_name (subparam1, "ReadFlagChange")) {
+			EEwsFolder *folder;
+
+			folder = parser (subparam1);
+			items_updated = g_slist_append (items_updated, folder);
+		}
 
 		for (subparam1 = e_soap_parameter_get_first_child_by_name (node, "Delete");
 		     subparam1 != NULL;
diff --git a/src/server/e-ews-item.c b/src/server/e-ews-item.c
index fd5d999..97c13af 100644
--- a/src/server/e-ews-item.c
+++ b/src/server/e-ews-item.c
@@ -863,6 +863,12 @@ e_ews_item_set_from_soap_parameter (EEwsItem *item, ESoapParameter *param)
 		priv->attachment_id = g_new0 (EwsId, 1);
 		priv->attachment_id->id = e_soap_parameter_get_property (node, "Id");
 		priv->attachment_id->change_key = e_soap_parameter_get_property (node, "ChangeKey");
+	} else if ((node = e_soap_parameter_get_first_child_by_name (param, "ItemId"))) {
+		/*Spesial case when we are facing  <ReadFlagChange> during sync folders*/
+		priv->item_id = g_new0 (EwsId, 1);
+		priv->item_id->id = e_soap_parameter_get_property (node, "Id");
+		priv->item_id->change_key = e_soap_parameter_get_property (node, "ChangeKey");
+		return TRUE;
 	} else if ((node = e_soap_parameter_get_first_child_by_name (param, "Message")))
 		priv->item_type = E_EWS_ITEM_TYPE_MESSAGE;
 	else if ((node = e_soap_parameter_get_first_child_by_name (param, "PostItem")))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]