evolution-data-server r9158 - in branches/EXCHANGE_MAPI_BRANCH: calendar/backends/mapi camel/providers/mapi servers/mapi



Author: msuman
Date: Mon Jul 21 11:22:05 2008
New Revision: 9158
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9158&view=rev

Log:
Handle meeting requests in Inbox folder, fixes in timezone conversions.

Modified:
   branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/ChangeLog
   branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-factory.c
   branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi.c
   branches/EXCHANGE_MAPI_BRANCH/camel/providers/mapi/ChangeLog
   branches/EXCHANGE_MAPI_BRANCH/camel/providers/mapi/camel-mapi-folder.c
   branches/EXCHANGE_MAPI_BRANCH/camel/providers/mapi/camel-mapi-folder.h
   branches/EXCHANGE_MAPI_BRANCH/servers/mapi/ChangeLog
   branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-cal-tz-utils.c
   branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-cal-utils.c
   branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-cal-utils.h
   branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-connection.c

Modified: branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-factory.c
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-factory.c	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-factory.c	Mon Jul 21 11:22:05 2008
@@ -25,7 +25,6 @@
 
 #include "e-cal-backend-mapi-factory.h"
 #include "e-cal-backend-mapi.h"
-#include <exchange-mapi-cal-tz-utils.h>
 
 #define d(x) 
 
@@ -201,15 +200,11 @@
 	mapi_types[0] = todos_backend_factory_get_type (module);
 	mapi_types[1] = events_backend_factory_get_type (module);
 	mapi_types[2] = journal_backend_factory_get_type (module);
-
-	exchange_mapi_cal_tz_util_populate ();
-	d(exchange_mapi_cal_tz_util_dump ());
 }
 
 void
 eds_module_shutdown   (void)
 {
-	exchange_mapi_cal_tz_util_destroy ();
 }
 
 void

Modified: branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi.c
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi.c	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi.c	Mon Jul 21 11:22:05 2008
@@ -529,7 +529,7 @@
 
 //	e_file_cache_freeze_changes (E_FILE_CACHE (priv->cache));
 	if (!exchange_mapi_connection_fetch_items (priv->fid, use_restriction ? &res : NULL, 
-						cal_GetPropsList, n_cal_GetPropsList, 
+						cal_GetPropsList, G_N_ELEMENTS (cal_GetPropsList), 
 						exchange_mapi_cal_util_build_name_id, GINT_TO_POINTER(kind), 
 						mapi_cal_get_changes_cb, cbmapi, 
 						MAPI_OPTIONS_FETCH_ALL)) {
@@ -553,7 +553,7 @@
 	 * so should not be freed, only the list should. */
 	priv->cache_keys = e_cal_backend_cache_get_keys (priv->cache);
 	if (!exchange_mapi_connection_fetch_items (priv->fid, NULL, 
-						cal_IDList, n_cal_IDList, 
+						cal_IDList, G_N_ELEMENTS (cal_IDList), 
 						NULL, NULL, 
 						handle_deleted_items_cb, cbmapi, 
 						0)) {
@@ -914,7 +914,7 @@
 
 //	e_file_cache_freeze_changes (E_FILE_CACHE (priv->cache));
 	if (!exchange_mapi_connection_fetch_items (priv->fid, NULL, 
-						cal_GetPropsList, n_cal_GetPropsList, 
+						cal_GetPropsList, G_N_ELEMENTS (cal_GetPropsList), 
 						exchange_mapi_cal_util_build_name_id, GINT_TO_POINTER(kind), 
 						mapi_cal_cache_create_cb, cbmapi, 
 						MAPI_OPTIONS_FETCH_ALL)) {

Modified: branches/EXCHANGE_MAPI_BRANCH/camel/providers/mapi/camel-mapi-folder.c
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/camel/providers/mapi/camel-mapi-folder.c	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/camel/providers/mapi/camel-mapi-folder.c	Mon Jul 21 11:22:05 2008
@@ -580,6 +580,139 @@
 
 }
 
+/* we don't have to specify the PR_BODY_* tags since it is fetched by default */
+static const uint32_t camel_GetPropsList[] = {
+	PR_FID, 
+	PR_MID, 
+
+	PR_MESSAGE_CLASS, 
+	PR_MESSAGE_SIZE, 
+	PR_MESSAGE_FLAGS, 
+	PR_MESSAGE_DELIVERY_TIME, 
+
+	PR_SUBJECT, 
+	PR_SUBJECT_UNICODE, 
+	PR_NORMALIZED_SUBJECT, 
+	PR_NORMALIZED_SUBJECT_UNICODE, 
+	PR_CONVERSATION_TOPIC, 
+	PR_CONVERSATION_TOPIC_UNICODE, 
+
+	PR_DISPLAY_TO, 
+	PR_DISPLAY_TO_UNICODE, 
+	PR_DISPLAY_CC, 
+	PR_DISPLAY_CC_UNICODE, 
+	PR_DISPLAY_BCC, 
+	PR_DISPLAY_BCC_UNICODE, 
+
+	PR_CREATION_TIME, 
+	PR_LAST_MODIFICATION_TIME, 
+	PR_PRIORITY, 
+	PR_SENSITIVITY, 
+	PR_START_DATE, 
+	PR_END_DATE, 
+	PR_RESPONSE_REQUESTED, 
+	PR_OWNER_APPT_ID, 
+
+	PR_SENT_REPRESENTING_NAME, 
+	PR_SENT_REPRESENTING_NAME_UNICODE, 
+	PR_SENT_REPRESENTING_ADDRTYPE, 
+	PR_SENT_REPRESENTING_ADDRTYPE_UNICODE, 
+	PR_SENT_REPRESENTING_EMAIL_ADDRESS, 
+	PR_SENT_REPRESENTING_EMAIL_ADDRESS_UNICODE, 
+
+	PR_SENDER_NAME, 
+	PR_SENDER_NAME_UNICODE, 
+	PR_SENDER_ADDRTYPE, 
+	PR_SENDER_ADDRTYPE_UNICODE, 
+	PR_SENDER_EMAIL_ADDRESS, 
+	PR_SENDER_EMAIL_ADDRESS_UNICODE, 
+
+	PR_RCVD_REPRESENTING_NAME, 
+	PR_RCVD_REPRESENTING_NAME_UNICODE, 
+	PR_RCVD_REPRESENTING_ADDRTYPE, 
+	PR_RCVD_REPRESENTING_ADDRTYPE_UNICODE, 
+	PR_RCVD_REPRESENTING_EMAIL_ADDRESS, 
+	PR_RCVD_REPRESENTING_EMAIL_ADDRESS_UNICODE
+};
+
+static gboolean 
+camel_build_name_id (struct mapi_nameid *nameid, gpointer data)
+{
+	mapi_nameid_lid_add(nameid, 0x8501, PSETID_Common); 	// PT_LONG - ReminderMinutesBeforeStart
+	mapi_nameid_lid_add(nameid, 0x8502, PSETID_Common); 	// PT_SYSTIME - ReminderTime
+	mapi_nameid_lid_add(nameid, 0x8503, PSETID_Common); 	// PT_BOOLEAN - ReminderSet
+	mapi_nameid_lid_add(nameid, 0x8506, PSETID_Common); 	// PT_BOOLEAN - Private
+	mapi_nameid_lid_add(nameid, 0x8510, PSETID_Common); 	// PT_LONG - (context menu flags)
+	mapi_nameid_lid_add(nameid, 0x8516, PSETID_Common); 	// PT_SYSTIME - CommonStart
+	mapi_nameid_lid_add(nameid, 0x8517, PSETID_Common); 	// PT_SYSTIME - CommonEnd
+	mapi_nameid_lid_add(nameid, 0x8560, PSETID_Common); 	// PT_SYSTIME - ReminderNextTime
+
+	mapi_nameid_lid_add(nameid, 0x8201, PSETID_Appointment); 	// PT_LONG - ApptSequence
+	mapi_nameid_lid_add(nameid, 0x8205, PSETID_Appointment); 	// PT_LONG - BusyStatus
+	mapi_nameid_lid_add(nameid, 0x8208, PSETID_Appointment); 	// PT_STRING8 - Location
+	mapi_nameid_lid_add(nameid, 0x820D, PSETID_Appointment); 	// PT_SYSTIME - Start/ApptStartWhole
+	mapi_nameid_lid_add(nameid, 0x820E, PSETID_Appointment); 	// PT_SYSTIME - End/ApptEndWhole
+	mapi_nameid_lid_add(nameid, 0x8213, PSETID_Appointment); 	// PT_LONG - Duration/ApptDuration
+	mapi_nameid_lid_add(nameid, 0x8215, PSETID_Appointment); 	// PT_BOOLEAN - AllDayEvent (also called ApptSubType)
+	mapi_nameid_lid_add(nameid, 0x8216, PSETID_Appointment); 	// PT_BINARY - (recurrence blob)
+	mapi_nameid_lid_add(nameid, 0x8217, PSETID_Appointment); 	// PT_LONG - MeetingStatus
+	mapi_nameid_lid_add(nameid, 0x8218, PSETID_Appointment); 	// PT_LONG - ResponseStatus
+	mapi_nameid_lid_add(nameid, 0x8223, PSETID_Appointment); 	// PT_BOOLEAN - Recurring
+	mapi_nameid_lid_add(nameid, 0x8224, PSETID_Appointment); 	// PT_LONG - IntendedBusyStatus
+	mapi_nameid_lid_add(nameid, 0x8228, PSETID_Appointment); 	// PT_SYSTIME - RecurrenceBase
+	mapi_nameid_lid_add(nameid, 0x8229, PSETID_Appointment); 	// PT_BOOLEAN - FInvited
+	mapi_nameid_lid_add(nameid, 0x8231, PSETID_Appointment); 	// PT_LONG - RecurrenceType
+	mapi_nameid_lid_add(nameid, 0x8232, PSETID_Appointment); 	// PT_STRING8 - RecurrencePattern
+	mapi_nameid_lid_add(nameid, 0x8235, PSETID_Appointment); 	// PT_SYSTIME - (dtstart)(for recurring events UTC 12 AM of day of start)
+	mapi_nameid_lid_add(nameid, 0x8236, PSETID_Appointment); 	// PT_SYSTIME - (dtend)(for recurring events UTC 12 AM of day of end)
+	mapi_nameid_lid_add(nameid, 0x823A, PSETID_Appointment); 	// PT_BOOLEAN - AutoFillLocation
+	mapi_nameid_lid_add(nameid, 0x8240, PSETID_Appointment); 	// PT_BOOLEAN - IsOnlineMeeting
+	mapi_nameid_lid_add(nameid, 0x8257, PSETID_Appointment); 	// PT_BOOLEAN - ApptCounterProposal
+	mapi_nameid_lid_add(nameid, 0x825E, PSETID_Appointment); 	// PT_BINARY - (timezone for dtstart)
+	mapi_nameid_lid_add(nameid, 0x825F, PSETID_Appointment); 	// PT_BINARY - (timezone for dtend)
+
+	mapi_nameid_lid_add(nameid, 0x0002, PSETID_Meeting); 		// PT_STRING8 - Where
+	mapi_nameid_lid_add(nameid, 0x0003, PSETID_Meeting); 		// PT_BINARY - GlobalObjectId
+	mapi_nameid_lid_add(nameid, 0x0005, PSETID_Meeting); 		// PT_BOOLEAN - IsRecurring
+	mapi_nameid_lid_add(nameid, 0x000a, PSETID_Meeting); 		// PT_BOOLEAN - IsException 
+	mapi_nameid_lid_add(nameid, 0x0023, PSETID_Meeting); 		// PT_BINARY - CleanGlobalObjectId
+	mapi_nameid_lid_add(nameid, 0x0024, PSETID_Meeting); 		// PT_STRING8 - AppointmentMessageClass 
+	mapi_nameid_lid_add(nameid, 0x0026, PSETID_Meeting); 		// PT_LONG - MeetingType
+
+	/* These probably would never be used from Evolution */
+//	mapi_nameid_lid_add(nameid, 0x8200, PSETID_Appointment); 	// PT_BOOLEAN - SendAsICAL
+//	mapi_nameid_lid_add(nameid, 0x8202, PSETID_Appointment); 	// PT_SYSTIME - ApptSequenceTime
+//	mapi_nameid_lid_add(nameid, 0x8214, PSETID_Appointment); 	// PT_LONG - Label
+//	mapi_nameid_lid_add(nameid, 0x8234, PSETID_Appointment); 	// PT_STRING8 - display TimeZone
+//	mapi_nameid_lid_add(nameid, 0x8238, PSETID_Appointment); 	// PT_STRING8 - AllAttendees
+//	mapi_nameid_lid_add(nameid, 0x823B, PSETID_Appointment); 	// PT_STRING8 - ToAttendeesString (dupe PR_DISPLAY_TO)
+//	mapi_nameid_lid_add(nameid, 0x823C, PSETID_Appointment); 	// PT_STRING8 - CCAttendeesString (dupe PR_DISPLAY_CC)
+
+	mapi_nameid_lid_add(nameid, 0x8101, PSETID_Task); 	// PT_LONG - Status
+	mapi_nameid_lid_add(nameid, 0x8102, PSETID_Task); 	// PT_DOUBLE - PercentComplete
+	mapi_nameid_lid_add(nameid, 0x8103, PSETID_Task); 	// PT_BOOLEAN - TeamTask
+	mapi_nameid_lid_add(nameid, 0x8104, PSETID_Task); 	// PT_SYSTIME - StartDate/TaskStartDate
+	mapi_nameid_lid_add(nameid, 0x8105, PSETID_Task); 	// PT_SYSTIME - DueDate/TaskDueDate
+	mapi_nameid_lid_add(nameid, 0x810F, PSETID_Task); 	// PT_SYSTIME - DateCompleted
+//	mapi_nameid_lid_add(nameid, 0x8116, PSETID_Task); 	// PT_BINARY - (recurrence blob)
+	mapi_nameid_lid_add(nameid, 0x811C, PSETID_Task); 	// PT_BOOLEAN - Complete
+	mapi_nameid_lid_add(nameid, 0x811F, PSETID_Task); 	// PT_STRING8 - Owner
+	mapi_nameid_lid_add(nameid, 0x8121, PSETID_Task); 	// PT_STRING8 - Delegator
+	mapi_nameid_lid_add(nameid, 0x8126, PSETID_Task); 	// PT_BOOLEAN - IsRecurring/TaskFRecur
+	mapi_nameid_lid_add(nameid, 0x8127, PSETID_Task); 	// PT_STRING8 - Role
+	mapi_nameid_lid_add(nameid, 0x8129, PSETID_Task); 	// PT_LONG - Ownership
+	mapi_nameid_lid_add(nameid, 0x812A, PSETID_Task); 	// PT_LONG - DelegationState
+
+	/* These probably would never be used from Evolution */
+//	mapi_nameid_lid_add(nameid, 0x8110, PSETID_Task); 	// PT_LONG - ActualWork/TaskActualEffort
+//	mapi_nameid_lid_add(nameid, 0x8111, PSETID_Task); 	// PT_LONG - TotalWork/TaskEstimatedEffort
+
+	/* These probably would never be used from Evolution */
+//	mapi_nameid_lid_add(nameid, 0x8B00, PSETID_Note); 	// PT_LONG - Color
+
+	return TRUE;
+}
+
 static gboolean
 fetch_item_cb 	(struct mapi_SPropValue_array *array, mapi_id_t fid, mapi_id_t mid, 
 		GSList *streams, GSList *recipients, GSList *attachments, gpointer data)
@@ -587,6 +720,7 @@
 	exchange_mapi_debug_property_dump (array);
 	long *flags;
 	struct FILETIME *delivery_date;
+	const char *msg_class;
 	NTTIME ntdate;
 
 	MapiItem *item = data;
@@ -595,15 +729,21 @@
 	item->mid = mid;
 
 	/* FixME : which on of this will fetch the subject. */
-	item->header.subject = g_strdup (find_mapi_SPropValue_data (array, PR_NORMALIZED_SUBJECT));
-
-	item->header.to = g_strdup (find_mapi_SPropValue_data (array, PR_DISPLAY_TO));
-	item->header.cc = g_strdup (find_mapi_SPropValue_data (array, PR_DISPLAY_CC));
-	item->header.bcc = g_strdup (find_mapi_SPropValue_data (array, PR_DISPLAY_BCC));
-	item->header.from = g_strdup (find_mapi_SPropValue_data (array, PR_SENT_REPRESENTING_NAME));
+	item->header.subject = g_strdup (exchange_mapi_util_find_array_propval (array, PR_NORMALIZED_SUBJECT));
+	item->header.to = g_strdup (exchange_mapi_util_find_array_propval (array, PR_DISPLAY_TO));
+	item->header.cc = g_strdup (exchange_mapi_util_find_array_propval (array, PR_DISPLAY_CC));
+	item->header.bcc = g_strdup (exchange_mapi_util_find_array_propval (array, PR_DISPLAY_BCC));
+	item->header.from = g_strdup (exchange_mapi_util_find_array_propval (array, PR_SENT_REPRESENTING_NAME));
 	item->header.size = *(glong *)(find_mapi_SPropValue_data (array, PR_MESSAGE_SIZE));
 
-	item->msg.body_plain_text = g_strdup (find_mapi_SPropValue_data (array, PR_BODY));
+	msg_class = (const char *)find_mapi_SPropValue_data (array, PR_MESSAGE_CLASS);
+	if (g_str_has_prefix (msg_class, "IPM.Schedule.")) {
+		item->msg.body_plain_text = exchange_mapi_cal_util_camel_helper (array, streams, recipients, attachments);
+		item->is_cal = TRUE;
+	} else { 
+		item->msg.body_plain_text = g_strdup (find_mapi_SPropValue_data (array, PR_BODY));
+		item->is_cal = FALSE;
+	}
 
 	delivery_date = (struct FILETIME *)find_mapi_SPropValue_data(array, PR_MESSAGE_DELIVERY_TIME);
 	if (delivery_date) {
@@ -714,9 +854,12 @@
 
 /*TODO: type = mapi_item_class_to_type (item); */
 
-	if (body)
-		camel_mime_part_set_content(part, body, strlen(body), "text/plain");
-	else
+	if (body) { 
+		if (item->is_cal)
+			camel_mime_part_set_content(part, body, strlen(body), "text/calendar");
+		else
+			camel_mime_part_set_content(part, body, strlen(body), "text/plain");
+	} else
 		camel_mime_part_set_content(part, " ", strlen(" "), "text/html");
 
 	camel_multipart_set_boundary (multipart, NULL);
@@ -803,18 +946,6 @@
 	CamelStream *stream, *cache_stream;
 	int errno;
 
-	const guint32 message_prop_list[] = {
-		PR_NORMALIZED_SUBJECT,
-		PR_DISPLAY_TO,
-		PR_DISPLAY_CC,
-		PR_DISPLAY_BCC,
-		PR_SENT_REPRESENTING_NAME,
-		PR_MESSAGE_SIZE,
-		PR_BODY,
-		PR_MESSAGE_DELIVERY_TIME,
-		PR_MESSAGE_FLAGS
-	};
-
 	/* see if it is there in cache */
 
 	mi = (CamelMapiMessageInfo *) camel_folder_summary_uid (folder->summary, uid);
@@ -877,10 +1008,10 @@
 
 	folder_id =  g_strdup (camel_mapi_store_folder_id_lookup (mapi_store, folder->full_name)) ;
 	exchange_mapi_connection_fetch_item (id_folder, id_message, 
-					message_prop_list, G_N_ELEMENTS (message_prop_list), 
-					NULL, NULL, 
+					camel_GetPropsList, G_N_ELEMENTS (camel_GetPropsList), 
+					camel_build_name_id, NULL, 
 					fetch_item_cb, item, 
-					MAPI_OPTIONS_FETCH_ATTACHMENTS | MAPI_OPTIONS_FETCH_BODY_STREAM | MAPI_OPTIONS_FETCH_BODY_STREAM);
+					MAPI_OPTIONS_FETCH_ALL);
 
 	if (item == NULL) {
 		camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_INVALID, _("Could not get message"));

Modified: branches/EXCHANGE_MAPI_BRANCH/camel/providers/mapi/camel-mapi-folder.h
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/camel/providers/mapi/camel-mapi-folder.h	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/camel/providers/mapi/camel-mapi-folder.h	Mon Jul 21 11:22:05 2008
@@ -88,6 +88,8 @@
 	MapiItemHeader header;
 	MapiItemMessage msg;
 
+	gboolean is_cal;
+
 	GSList *attachments;
 	GSList *generic_streams;
 }MapiItem;

Modified: branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-cal-tz-utils.c
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-cal-tz-utils.c	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-cal-tz-utils.c	Mon Jul 21 11:22:05 2008
@@ -34,61 +34,48 @@
 static GHashTable *mapi_to_ical = NULL;
 static GHashTable *ical_to_mapi = NULL;
 
-static const gchar *lru_mapi_id = NULL;
-static const gchar *lru_ical_id = NULL;
-
 const gchar *
 exchange_mapi_cal_tz_util_get_mapi_equivalent (const gchar *ical_tzid)
 {
+	const gchar *retval = NULL;
+
 	g_return_val_if_fail ((ical_tzid && *ical_tzid), NULL);
 
 	g_static_rec_mutex_lock(&mutex);
-	if (!(mapi_to_ical && ical_to_mapi)) {
+	if (!exchange_mapi_cal_tz_util_populate()) {
 		g_static_rec_mutex_unlock(&mutex);
 		return NULL;
 	}
 
 	d(g_message("%s(%d): %s of '%s' ", __FILE__, __LINE__, __PRETTY_FUNCTION__, ical_tzid));
 
-	if (lru_ical_id && !g_ascii_strcasecmp (ical_tzid, lru_ical_id)) {
-		g_static_rec_mutex_unlock(&mutex);
-		return lru_mapi_id;
-	}
-
-	lru_mapi_id = lru_ical_id = NULL;
-	if ((lru_mapi_id = g_hash_table_lookup (ical_to_mapi, ical_tzid)) != NULL)
-		lru_ical_id = ical_tzid;
+	retval = g_hash_table_lookup (ical_to_mapi, ical_tzid);
 
 	g_static_rec_mutex_unlock(&mutex);
 
-	return lru_mapi_id;
+	return retval;
 }
 
 const gchar *
 exchange_mapi_cal_tz_util_get_ical_equivalent (const gchar *mapi_tzid)
 {
+	const gchar *retval = NULL;
+
 	g_return_val_if_fail ((mapi_tzid && *mapi_tzid), NULL);
 
 	g_static_rec_mutex_lock(&mutex);
-	if (!(mapi_to_ical && ical_to_mapi)) {
+	if (!exchange_mapi_cal_tz_util_populate()) {
 		g_static_rec_mutex_unlock(&mutex);
 		return NULL;
 	}
 
 	d(g_message("%s(%d): %s of '%s' ", __FILE__, __LINE__, __PRETTY_FUNCTION__, mapi_tzid));
 
-	if (lru_mapi_id && !g_ascii_strcasecmp (mapi_tzid, lru_mapi_id)) {
-		g_static_rec_mutex_unlock(&mutex);
-		return lru_ical_id;
-	}
-
-	lru_ical_id = lru_mapi_id = NULL;
-	if ((lru_ical_id = g_hash_table_lookup (mapi_to_ical, mapi_tzid)) != NULL)
-		lru_mapi_id = mapi_tzid;
+	retval = g_hash_table_lookup (mapi_to_ical, mapi_tzid);
 
 	g_static_rec_mutex_unlock(&mutex);
 
-	return lru_ical_id;
+	return retval;
 }
 
 void
@@ -107,9 +94,6 @@
 	mapi_to_ical = NULL;
 	ical_to_mapi = NULL;
 
-	lru_mapi_id = NULL;
-	lru_ical_id = NULL;
-
 	g_static_rec_mutex_unlock(&mutex);
 }
 
@@ -194,7 +178,10 @@
 	g_mapped_file_free (mtoi_mf);
 	g_mapped_file_free (itom_mf);
 
+	d(exchange_mapi_cal_tz_util_dump ());
+
 	g_static_rec_mutex_unlock(&mutex);
+
 	return TRUE;
 }
 

Modified: branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-cal-utils.c
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-cal-utils.c	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-cal-utils.c	Mon Jul 21 11:22:05 2008
@@ -240,8 +240,10 @@
 exchange_mapi_cal_util_fetch_recipients (ECalComponent *comp, GSList **recip_list)
 {
 	GSList *al = NULL, *l;
+	ECalComponentOrganizer organizer;
 
 	e_cal_component_get_attendee_list (comp, &al);
+	e_cal_component_get_organizer (comp, &organizer);
 
 	for (l = al; l != NULL; l = l->next) {
 		ECalComponentAttendee *attendee = (ECalComponentAttendee *)(l->data);
@@ -256,7 +258,7 @@
 		recipient->in.req_cValues = 5;
 		val = 0;
 		set_SPropValue_proptag (&(recipient->in.req_lpProps[0]), PR_SEND_INTERNET_ENCODING, (const void *)&val);
-		val = RECIP_SENDABLE;
+		val = RECIP_SENDABLE | (!g_ascii_strcasecmp(recipient->email_id, organizer.value) ? RECIP_ORGANIZER : 0);
 		set_SPropValue_proptag (&(recipient->in.req_lpProps[1]), PR_RECIPIENTS_FLAGS, (const void *)&val);
 		val = get_trackstatus_from_partstat (attendee->status);
 		set_SPropValue_proptag (&(recipient->in.req_lpProps[2]), PR_RECIPIENT_TRACKSTATUS, (const void *)&val);
@@ -796,6 +798,7 @@
 	char *str = NULL;
 	char *tmp;
 	icalcomponent *icalcomp = NULL;
+
 	comp = exchange_mapi_cal_util_mapi_props_to_comp (ICAL_VEVENT_COMPONENT, e_cal_component_gen_uid(), 
 						properties, streams, recipients, NULL, NULL, 
 						NULL);
@@ -821,6 +824,7 @@
 					exchange_mapi_cal_util_build_name_id, GINT_TO_POINTER(ICAL_VEVENT_COMPONENT),
 					exchange_mapi_cal_util_build_props, &cbdata, 
 					myrecipients, myattachments, NULL, MAPI_OPTIONS_DONT_SUBMIT);
+	g_free (cbdata.props);
 	exchange_mapi_util_free_recipient_list (&myrecipients);
 
 	tmp = exchange_mapi_util_mapi_id_to_string (mid);

Modified: branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-cal-utils.h
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-cal-utils.h	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-cal-utils.h	Mon Jul 21 11:22:05 2008
@@ -96,13 +96,10 @@
 
 	PR_SUBJECT, 
 	PR_SUBJECT_UNICODE, 
-	PR_SUBJECT_ERROR, 
 	PR_NORMALIZED_SUBJECT, 
 	PR_NORMALIZED_SUBJECT_UNICODE, 
-	PR_NORMALIZED_SUBJECT_ERROR, 
 	PR_CONVERSATION_TOPIC, 
 	PR_CONVERSATION_TOPIC_UNICODE, 
-	PR_CONVERSATION_TOPIC_ERROR, 
 
 	PR_CREATION_TIME, 
 	PR_LAST_MODIFICATION_TIME, 
@@ -111,6 +108,7 @@
 	PR_START_DATE, 
 	PR_END_DATE, 
 	PR_RESPONSE_REQUESTED, 
+	PR_OWNER_APPT_ID, 
 
 	PR_SENT_REPRESENTING_NAME, 
 	PR_SENT_REPRESENTING_NAME_UNICODE, 
@@ -133,13 +131,11 @@
 	PR_RCVD_REPRESENTING_EMAIL_ADDRESS, 
 	PR_RCVD_REPRESENTING_EMAIL_ADDRESS_UNICODE
 };
-static const uint16_t n_cal_GetPropsList = G_N_ELEMENTS (cal_GetPropsList);
 
 static const uint32_t cal_IDList[] = {
 	PR_FID, 
 	PR_MID
 };
-static const uint16_t n_cal_IDList = G_N_ELEMENTS (cal_IDList);
 
 G_END_DECLS
 

Modified: branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-connection.c
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-connection.c	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-connection.c	Mon Jul 21 11:22:05 2008
@@ -165,6 +165,7 @@
 	g_return_val_if_fail (proptag != PR_RTF_COMPRESSED, FALSE);
 
 	d(g_print("\n%s(%d): Entering %s ", __FILE__, __LINE__, __PRETTY_FUNCTION__));
+	d(g_print("\nAttempt to read stream for proptag 0x%08X ", proptag));
 
 	mem_ctx = talloc_init ("ExchangeMAPI_ReadGenericStream");
 
@@ -233,6 +234,7 @@
 		stream->value = g_byte_array_append (stream->value, body.data, body.length);
 
 		stream->proptag = properties_array.lpProps[0].ulPropTag;
+		d(g_print("\nAttempt succeeded for proptag 0x%08X (after name conversion) ", stream->proptag));
 
 		*stream_list = g_slist_append (*stream_list, stream);
 	}



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