[evolution-ews] Fetch AssociatedCalendarItemId ChangeKey for future use in accept meetings



commit bd4de806f6fbc79e330a93b9606ed53e60bee0ae
Author: Pavel Ocheretny <pocheretny src gnome com>
Date:   Sun May 22 15:23:48 2011 +0300

    Fetch AssociatedCalendarItemId ChangeKey for future use in accept meetings

 src/camel/camel-ews-folder.c |    2 +-
 src/server/e-ews-item.c      |   20 +++++++++++++-------
 src/server/e-ews-item.h      |    3 +++
 3 files changed, 17 insertions(+), 8 deletions(-)
---
diff --git a/src/camel/camel-ews-folder.c b/src/camel/camel-ews-folder.c
index 5196d25..412cb98 100644
--- a/src/camel/camel-ews-folder.c
+++ b/src/camel/camel-ews-folder.c
@@ -378,7 +378,7 @@ camel_ews_folder_get_message (CamelFolder *folder, const gchar *uid, gint pri, G
 			}
 			goto exit;
 		}
-		associatedcalendarid = e_ews_item_get_associatedcalendarid (items_req->data);
+		associatedcalendarid = (e_ews_item_get_associated_calendar_item_id (items_req->data))->id;
 
 		mime_fname_new = ews_update_mgtrequest_mime_calendar_itemid (mime_content,
 									     associatedcalendarid,
diff --git a/src/server/e-ews-item.c b/src/server/e-ews-item.c
index e86314f..fd42ea9 100644
--- a/src/server/e-ews-item.c
+++ b/src/server/e-ews-item.c
@@ -167,7 +167,7 @@ struct _EEwsItemPrivate {
 	GSList *attachments_list;
 	GSList *attendees;
 
-	gchar *associatedcalendaritemid;
+	EwsId *associated_calendar_item_id;
 
 	struct _EEwsContactFields *contact_fields;
 };
@@ -245,8 +245,12 @@ e_ews_item_dispose (GObject *object)
 
 	}
 
-	g_free (priv->associatedcalendaritemid);
-	priv->associatedcalendaritemid = NULL;
+	if (priv->associated_calendar_item_id) {
+		g_free (priv->associated_calendar_item_id->id);
+		g_free (priv->associated_calendar_item_id->change_key);
+		g_free (priv->associated_calendar_item_id);
+		priv->associated_calendar_item_id = NULL;
+	}
 
 	ews_item_free_mailbox (priv->sender);
 	ews_item_free_mailbox (priv->from);
@@ -801,7 +805,9 @@ e_ews_item_set_from_soap_parameter (EEwsItem *item, ESoapParameter *param)
 		} else if (!g_ascii_strcasecmp (name, "OptionalAttendees")) {
 			process_attendees (priv, subparam, "Optional");
 		} else if (!g_ascii_strcasecmp (name, "AssociatedCalendarItemId")) {
-			priv->associatedcalendaritemid = e_soap_parameter_get_property (subparam, "Id");
+			priv->associated_calendar_item_id = g_new0 (EwsId, 1);
+			priv->associated_calendar_item_id->id = e_soap_parameter_get_property (subparam, "Id");
+			priv->associated_calendar_item_id->change_key = e_soap_parameter_get_property (subparam, "ChangeKey");
 		}
 	}
 
@@ -1167,12 +1173,12 @@ e_ews_item_get_attendees (EEwsItem *item)
 	return item->priv->attendees;
 }
 
-const gchar *
-e_ews_item_get_associatedcalendarid (EEwsItem *item)
+const EwsId *
+e_ews_item_get_associated_calendar_item_id (EEwsItem *item)
 {
 	g_return_val_if_fail(E_IS_EWS_ITEM(item), NULL);
 
-	return (const gchar*) item->priv->associatedcalendaritemid;
+	return (const EwsId*) item->priv->associated_calendar_item_id;
 }
 
 const gchar *
diff --git a/src/server/e-ews-item.h b/src/server/e-ews-item.h
index be540e7..f4982bd 100644
--- a/src/server/e-ews-item.h
+++ b/src/server/e-ews-item.h
@@ -162,6 +162,9 @@ const GSList *	e_ews_item_get_attendees	(EEwsItem *item);
 
 const gchar *	e_ews_item_get_associatedcalendarid
 						(EEwsItem *item);
+const EwsId *	e_ews_item_get_associated_calendar_item_id
+						(EEwsItem *item);
+
 /* Contact fields */
 const gchar *	e_ews_item_get_fileas		(EEwsItem *item);
 const EwsCompleteName *	



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