evolution-data-server r8677 - branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi



Author: msuman
Date: Thu Apr 24 06:35:05 2008
New Revision: 8677
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=8677&view=rev

Log:
Fix for memory leaks, initial work towards support of meetings/assigned tasks, initialize and destroy the timezone hashtables with MAPIFactory rather than the backends.

Added:
   branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-constants.h
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-tz-utils.c
   branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-utils.c
   branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi.c

Added: branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-constants.h
==============================================================================
--- (empty file)
+++ branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-constants.h	Thu Apr 24 06:35:05 2008
@@ -0,0 +1,147 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ *  Suman Manjunath <msuman novell com>
+ *  Copyright (C) 2007 Novell, Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+
+#ifndef E_CAL_BACKEND_MAPI_CONSTANTS_H
+#define E_CAL_BACKEND_MAPI_CONSTANTS_H
+
+G_BEGIN_DECLS
+
+/* GENERAL */
+enum OlDaysOfWeek
+{
+    olSunday = 1,
+    olMonday = 2,
+    olTuesday = 4,
+    olWednesday = 8,
+    olThursday = 16,
+    olFriday = 32,
+    olSaturday = 64
+};
+
+enum OlSensitivity
+{
+    olNormal = 0,
+    olPersonal = 1,
+    olPrivate = 2,
+    olConfidential = 3
+};
+
+enum OlImportance
+{
+    olImportanceLow = 0,
+    olImportanceNormal = 1,
+    olImportanceHigh = 2
+};
+
+/* APPOINTMENTS */
+enum OlBusyStatus
+{
+    olFree = 0,
+    olTentative = 1,
+    olBusy = 2,
+    olOutOfOffice = 3
+};
+
+enum OlMeetingRecipientType
+{
+    olOrganizer = 0,
+    olRequired = 1,
+    olOptional = 2,
+    olResource = 3
+};
+
+enum OlMeetingResponse
+{
+    olMeetingTentative = 2,
+    olMeetingAccepted = 3,
+    olMeetingDeclined = 4
+};
+
+enum OlMeetingStatus
+{
+    olNonMeeting = 0,
+    olMeeting = 1,
+    olMeetingReceived = 3,
+    olMeetingCanceled = 5
+};
+
+/* TASKS */
+enum OlTaskDelegationState
+{
+    olTaskNotDelegated = 0,
+    olTaskDelegationUnknown = 1,
+    olTaskDelegationAccepted = 2,
+    olTaskDelegationDeclined = 3
+};
+/*
+enum OlTaskOwnership
+{
+    olNewTask = 0,
+    olDelegatedTask = 1,
+    olOwnTask = 2
+};
+*/
+enum OlTaskRecipientType
+{
+    olUpdate = 2,
+    olFinalStatus = 3
+};
+
+enum OlTaskResponse
+{
+    olTaskSimple = 0,
+    olTaskAssign = 1,
+    olTaskAccept = 2,
+    olTaskDecline = 3
+};
+/*
+enum OlTaskStatus
+{
+    olTaskNotStarted = 0,
+    olTaskInProgress = 1,
+    olTaskComplete = 2,
+    olTaskWaiting = 3,
+    olTaskDeferred = 4
+};
+*/
+/* RECURRENCE */
+enum OlRecurrenceState
+{
+    olApptNotRecurring = 0,
+    olApptMaster = 1,
+    olApptOccurrence = 2,
+    olApptException = 3
+};
+
+enum OlRecurrenceType
+{
+    olRecursDaily = 0,
+    olRecursWeekly = 1,
+    olRecursMonthly = 2,
+    olRecursMonthNth = 3,
+    olRecursYearly = 5,
+    olRecursYearNth = 6
+};
+
+G_END_DECLS
+
+#endif

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	Thu Apr 24 06:35:05 2008
@@ -26,6 +26,8 @@
 
 #include "e-cal-backend-mapi-factory.h"
 #include "e-cal-backend-mapi.h"
+#include "e-cal-backend-mapi-tz-utils.h"
+#define d(x) 
 
 typedef struct {
 	ECalBackendFactory            parent_object;
@@ -199,11 +201,15 @@
 	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);
+
+	e_cal_backend_mapi_tz_util_populate ();
+	d(e_cal_backend_mapi_tz_util_dump ());
 }
 
 void
 eds_module_shutdown   (void)
 {
+	e_cal_backend_mapi_tz_util_destroy ();
 }
 
 void

Modified: branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-tz-utils.c
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-tz-utils.c	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-tz-utils.c	Thu Apr 24 06:35:05 2008
@@ -21,6 +21,7 @@
 
 
 #include "e-cal-backend-mapi.h"
+#include "e-cal-backend-mapi-constants.h"
 #include "e-cal-backend-mapi-tz-utils.h"
 
 #define d(x) 

Modified: branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-utils.c
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-utils.c	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-utils.c	Thu Apr 24 06:35:05 2008
@@ -33,6 +33,7 @@
 #include <fcntl.h>
 
 #include "e-cal-backend-mapi.h"
+#include "e-cal-backend-mapi-constants.h"
 #include "e-cal-backend-mapi-utils.h"
 #include "e-cal-backend-mapi-tz-utils.h"
 #if 0
@@ -46,50 +47,6 @@
 #define	PRIORITY_NORMAL 0
 #define	PRIORITY_HIGH 	1
 
-/*
- * Importance
- */
-
-#define	IMPORTANCE_LOW 		0
-#define	IMPORTANCE_NORMAL 	1
-#define	IMPORTANCE_HIGH		2
-
-/*
- * Sensitivity
- */
-
-#define	SENSITIVITY_NORMAL 		0
-#define	SENSITIVITY_PERSONAL 		1
-#define	SENSITIVITY_PRIVATE 		2
-#define SENSITIVITY_CONFIDENTIAL 	3
-
-/*
- * Appointment flags with PR_APPOINTMENT_BUSY_STATUS
- */
-
-#define	BUSY_STATUS_FREE 	0
-#define	BUSY_STATUS_TENTATIVE 	1
-#define	BUSY_STATUS_BUSY 	2
-#define	BUSY_STATUS_OUTOFOFFICE 3
-
-/*
- * Task OwnerShip
- */
-
-#define	olNewTask 	0
-#define	olDelegatedTask 1
-#define	olOwnTask 	2
-
-/*
- * Task status
- */
-
-#define	olTaskNotStarted 	0
-#define	olTaskInProgress 	1
-#define	olTaskComplete 		2
-#define	olTaskWaiting 		3
-#define	olTaskDeferred 		4
-
 static void appt_build_name_id (struct mapi_nameid *nameid);
 static void task_build_name_id (struct mapi_nameid *nameid);
 static void note_build_name_id (struct mapi_nameid *nameid);
@@ -223,35 +180,81 @@
 	e_cal_component_set_attachment_list (comp, comp_attach_list);
 }
 
-#define REQUIRED 0
-#define OPTIONAL 0
-#define RESOURCE 0
-#define MEET_ORGANIZER 0
-#define MEET_ATTENDEE 0
+#define PARTICIPANT 	0x2
+#define MEET_ORGANIZER 	PARTICIPANT << 0x0
+#define MEET_ATTENDEE  	PARTICIPANT << 0x8
+
+static icalparameter_role
+get_role_from_type (ExchangeMAPIRecipientType type)
+{
+	switch (type) {
+		case RECIPIENT_ORIG : 
+		case RECIPIENT_TO   : 
+		case RECIPIENT_BCC  : return ICAL_ROLE_REQPARTICIPANT;
+		case RECIPIENT_CC   : return ICAL_ROLE_OPTPARTICIPANT;
+		default 	    : return ICAL_ROLE_REQPARTICIPANT;
+	}
+}
+
+static icalparameter_partstat
+get_partstat_from_trackstatus (uint32_t trackstatus)
+{
+	switch (trackstatus) {
+		case olMeetingTentative : return ICAL_PARTSTAT_TENTATIVE;
+		case olMeetingAccepted  : return ICAL_PARTSTAT_ACCEPTED;
+		case olMeetingDeclined  : return ICAL_PARTSTAT_DECLINED;
+		default 		: return ICAL_PARTSTAT_NEEDSACTION;
+	}
+}
 
 static void 
 ical_attendees_from_props (icalcomponent *ical_comp, GSList *recipients)
 {
-/*** ALERT: INCOMPLETE ***/
 	GSList *l;
 	for (l=recipients; l; l=l->next) {
 		ExchangeMAPIRecipient *recip = (ExchangeMAPIRecipient *)(l->data);
-		icalproperty *prop;
+		icalproperty *prop = NULL;
 		icalparameter *param;
-		/* ORG / ATT */
-		if (recip->flags & MEET_ATTENDEE)
-			prop = icalproperty_new_attendee (recip->email_id);
-		else if (recip->flags & MEET_ORGANIZER)
-			prop = icalproperty_new_organizer (recip->email_id);
-		/* CN */
-		param = icalparameter_new_cn (recip->name);
-		icalproperty_add_parameter (prop, param);
-		/* PARTSTAT */
-		//param = icalparameter_new_partstat ();
+		gchar *val;
+
+		if (recip->email_id)
+			val = g_strdup_printf ("MAILTO:%s", recip->email_id);
+		else 
+			continue;
+
+		if (recip->flags & MEET_ORGANIZER) {
+			prop = icalproperty_new_organizer (val);
+			/* CN */
+			param = icalparameter_new_cn (recip->name);
+			icalproperty_add_parameter (prop, param);
+		} else /* if (recip->flags & MEET_ATTENDEE) */ {
+			prop = icalproperty_new_attendee (val);
+			/* CN */
+			param = icalparameter_new_cn (recip->name);
+			icalproperty_add_parameter (prop, param);
+			/* RSVP */
+			param = icalparameter_new_rsvp (ICAL_RSVP_TRUE);
+			icalproperty_add_parameter (prop, param);
+			/* PARTSTAT */
+			param = icalparameter_new_partstat (get_partstat_from_trackstatus (recip->trackstatus));
+			icalproperty_add_parameter (prop, param);
+			/* ROLE */
+			param = icalparameter_new_role (get_role_from_type (recip->type));
+			icalproperty_add_parameter (prop, param);
+#if 0
+			/* CALENDAR USER TYPE */
+			param = icalparameter_new_cutype ();
+			icalproperty_add_parameter (prop, param);
+#endif
+		}
+
+		if (prop)
+			icalcomponent_add_property (ical_comp, prop);
+
+		g_free (val);
 	}
 }
 
-
 ECalComponent *
 e_cal_backend_mapi_props_to_comp (ECalBackendMAPI *cbmapi, const gchar *mid, struct mapi_SPropValue_array *properties, 
 				  GSList *streams, GSList *recipients, GSList *attachments, const icaltimezone *default_zone)
@@ -263,6 +266,7 @@
 	const bool *b;
 	icalcomponent *ical_comp;
 	icalproperty *prop = NULL;
+	icalparameter *param = NULL;
 	ExchangeMAPIStream *body;
 
 	switch (e_cal_backend_get_kind (E_CAL_BACKEND (cbmapi))) {
@@ -353,13 +357,13 @@
 			icalproperty_transp ical_transp;
 			switch (*ui32) {
 				/* FIXME: is this mapping correct ? */
-				case BUSY_STATUS_TENTATIVE:
-				case BUSY_STATUS_FREE:
+				case olFree:
+				case olTentative:
 					ical_transp = ICAL_TRANSP_TRANSPARENT;
 					break;
 				/* FIXME: is this mapping correct ? */
-				case BUSY_STATUS_OUTOFOFFICE:
-				case BUSY_STATUS_BUSY:
+				case olBusy:
+				case olOutOfOffice:
 					ical_transp = ICAL_TRANSP_OPAQUE;
 					break;
 				default:
@@ -380,6 +384,41 @@
 			}
 */		} 
 
+		if (recipients) {
+			g_print ("\n\nFound a group event...\n");
+			ical_attendees_from_props (ical_comp, recipients);
+			if (icalcomponent_get_first_property (ical_comp, ICAL_ORGANIZER_PROPERTY) == NULL) {
+				gchar *val;
+//				const char *sender_name = (const char *) exchange_mapi_util_find_array_propval (properties, PR_SENDER_NAME);
+				const char *sender_email_type = (const char *) exchange_mapi_util_find_array_propval (properties, PR_SENDER_ADDRTYPE);
+				const char *sender_email = (const char *) exchange_mapi_util_find_array_propval (properties, PR_SENDER_EMAIL_ADDRESS);
+				const char *sent_name = (const char *) exchange_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_NAME);
+				const char *sent_email_type = (const char *) exchange_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_ADDRTYPE);
+				const char *sent_email = (const char *) exchange_mapi_util_find_array_propval (properties, PR_SENT_REPRESENTING_EMAIL_ADDRESS);
+
+				if (!g_utf8_collate (sender_email_type, "EX"))
+					sender_email = exchange_mapi_util_ex_to_smtp (sender_email);
+				if (!g_utf8_collate (sent_email_type, "EX"))
+					sent_email = exchange_mapi_util_ex_to_smtp (sent_email);
+
+				val = g_strdup_printf ("MAILTO:%s", sent_email);
+				prop = icalproperty_new_organizer (val);
+				g_free (val);
+				/* CN */
+				param = icalparameter_new_cn (sent_name);
+				icalproperty_add_parameter (prop, param);
+				/* SENTBY */
+				if (g_utf8_collate (sent_email, sender_email)) {
+					val = g_strdup_printf ("MAILTO:%s", sender_email);
+					param = icalparameter_new_sentby (val);
+					icalproperty_add_parameter (prop, param);
+					g_free (val);
+				}
+
+				icalcomponent_add_property (ical_comp, prop);
+			}
+		}
+
 		/* FIXME: the ALARM definitely needs more work */
 		b = (const bool *)find_mapi_SPropValue_data(properties, PROP_TAG(PT_BOOLEAN, 0x8503));
 		if (b && *b) {
@@ -507,15 +546,15 @@
 	if (ui32) {
 		icalproperty_class ical_class = ICAL_CLASS_NONE;
 		switch (*ui32) {
-			case SENSITIVITY_NORMAL:
+			case olNormal:
 				ical_class = ICAL_CLASS_PUBLIC;
 				break;
 			/* FIXME: is this mapping correct ? */
-			case SENSITIVITY_PERSONAL:
-			case SENSITIVITY_PRIVATE:
+			case olPersonal:
+			case olPrivate:
 				ical_class = ICAL_CLASS_PRIVATE;
 				break;
-			case SENSITIVITY_CONFIDENTIAL:
+			case olConfidential:
 				ical_class = ICAL_CLASS_CONFIDENTIAL;
 				break;
 			default: 
@@ -600,12 +639,11 @@
  */
 
 
-#define APPT_NAMED_PROPS_N  18
+#define APPT_NAMED_PROPS_N  19
 #define DEFAULT_APPT_REMINDER_MINS 15
 
 typedef enum 
 {
-//	I_SENDASICAL = COMMON_NAMED_PROPS_N , 
 	I_APPT_BUSYSTATUS = COMMON_NAMED_PROPS_N , 
 	I_APPT_LOCATION , 
 	I_APPT_START , 
@@ -614,7 +652,7 @@
 	I_APPT_ALLDAY , 
 	I_APPT_RECURBLOB , 
 	I_APPT_MEETINGSTATUS , 
-//	I_APPT_RESPONSESTATUS , 
+	I_APPT_RESPONSESTATUS , 
 	I_APPT_ISRECURRING , 
 	I_APPT_RECURBASE , 
 	I_APPT_RECURTYPE , 
@@ -628,6 +666,7 @@
 	I_APPT_COUNTERPROPOSAL , 
 	I_APPT_STARTTZBLOB , 
 	I_APPT_ENDTZBLOB 
+//	I_SENDASICAL , 
 //	I_APPT_LABEL , 
 //	I_APPT_DISPTZ 
 } ApptNamedPropsIndex;
@@ -635,7 +674,6 @@
 static void 
 appt_build_name_id (struct mapi_nameid *nameid)
 {
-//	mapi_nameid_lid_add(nameid, 0x8200, PSETID_Appointment); 	// PT_BOOLEAN - SendAsICAL
 	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
@@ -644,7 +682,7 @@
 	mapi_nameid_lid_add(nameid, 0x8215, PSETID_Appointment); 	// PT_BOOLEAN - AllDayEvent
 	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, 0x8218, PSETID_Appointment); 	// PT_LONG - ResponseStatus
 	mapi_nameid_lid_add(nameid, 0x8223, PSETID_Appointment); 	// PT_BOOLEAN - IsRecurring/Recurring
 	mapi_nameid_lid_add(nameid, 0x8228, PSETID_Appointment); 	// PT_SYSTIME - RecurrenceBase
 	mapi_nameid_lid_add(nameid, 0x8231, PSETID_Appointment); 	// PT_LONG - RecurrenceType
@@ -660,30 +698,31 @@
 	mapi_nameid_lid_add(nameid, 0x825F, PSETID_Appointment); 	// PT_BINARY - (timezone for dtend)
 
 	/* These probably would never be used from Evolution */
+//	mapi_nameid_lid_add(nameid, 0x8200, PSETID_Appointment); 	// PT_BOOLEAN - SendAsICAL
 //	mapi_nameid_lid_add(nameid, 0x8214, PSETID_Appointment); 	// PT_LONG - Label
 //	mapi_nameid_lid_add(nameid, 0x8234, PSETID_Appointment); 	// PT_STRING8 - display TimeZone
 }
 
 
-#define TASK_NAMED_PROPS_N 7
+#define TASK_NAMED_PROPS_N 13
 #define DEFAULT_TASK_REMINDER_MINS 1080
 
 typedef enum 
 {
 	I_TASK_STATUS = COMMON_NAMED_PROPS_N , 
 	I_TASK_PERCENT , 
-//	I_TASK_ISTEAMTASK , 
+	I_TASK_ISTEAMTASK , 
 	I_TASK_START , 
 	I_TASK_DUE , 
 	I_TASK_COMPLETED , 
 //	I_TASK_RECURBLOB , 
 	I_TASK_ISCOMPLETE , 
-//	I_TASK_OWNER , 
-//	I_TASK_DELEGATOR , 
+	I_TASK_OWNER , 
+	I_TASK_DELEGATOR , 
 	I_TASK_ISRECURRING , 
-//	I_TASK_ROLE , 
-//	I_TASK_OWNERSHIP , 
-//	I_TASK_DELEGATIONSTATE , 
+	I_TASK_ROLE , 
+	I_TASK_OWNERSHIP , 
+	I_TASK_DELEGATIONSTATE , 
 //	I_TASK_ACTUALWORK , 
 //	I_TASK_TOTALWORK 
 } TaskNamedPropsIndex;
@@ -693,18 +732,18 @@
 {
 	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, 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, 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
+	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
@@ -866,18 +905,18 @@
 	set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[I_COMMON_REMNEXTTIME], &t);
 
 	/* Sensitivity, Private */
-	flag32 = SENSITIVITY_NORMAL; 	/* default */
+	flag32 = olNormal; 	/* default */
 	b = 0; 				/* default */
 	prop = icalcomponent_get_first_property (ical_comp, ICAL_CLASS_PROPERTY);
 	if (prop) 
 		switch (icalproperty_get_class (prop)) {
 			/* FIXME: is this mapping correct ? */
 			case ICAL_CLASS_PRIVATE:
-				flag32 = SENSITIVITY_PRIVATE;
+				flag32 = olPrivate;
 				b = 1;
 				break;
 			case ICAL_CLASS_CONFIDENTIAL:
-				flag32 = SENSITIVITY_CONFIDENTIAL;
+				flag32 = olConfidential;
 				b = 1;
 				break;
 			default: 
@@ -905,18 +944,18 @@
 		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_CTXMENUFLAGS], (const void *) &flag32);
 
 		/* Busy Status */
-		flag32 = BUSY_STATUS_BUSY; 	/* default */
+		flag32 = olBusy; 	/* default */
 		prop = icalcomponent_get_first_property (ical_comp, ICAL_TRANSP_PROPERTY);
 		if (prop)
 			switch (icalproperty_get_transp (prop)) {
 				/* FIXME: is this mapping correct ? */
 				case ICAL_TRANSP_TRANSPARENT:
 				case ICAL_TRANSP_TRANSPARENTNOCONFLICT:
-					flag32 = BUSY_STATUS_FREE;
+					flag32 = olFree;
 					break;
 				case ICAL_TRANSP_OPAQUE:
 				case ICAL_TRANSP_OPAQUENOCONFLICT:
-					flag32 = BUSY_STATUS_BUSY;
+					flag32 = olBusy;
 					break;
 				default:
 					break;

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	Thu Apr 24 06:35:05 2008
@@ -24,8 +24,6 @@
 
 #include "e-cal-backend-mapi.h"
 #include "e-cal-backend-mapi-utils.h"
-#include "e-cal-backend-mapi-tz-utils.h"
-
 #define d(x) x
 
 #ifdef G_OS_WIN32
@@ -214,8 +212,6 @@
 	g_free (priv);
 	cbmapi->priv = NULL;
 
-//	e_cal_backend_mapi_tz_util_destroy ();
-
 	if (G_OBJECT_CLASS (parent_class)->finalize)
 		(* G_OBJECT_CLASS (parent_class)->finalize) (object);
 }
@@ -373,8 +369,11 @@
 	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, 
@@ -405,6 +404,9 @@
 	/* FIXME: Provide support for meetings/assigned tasks */
 	if (recipients != NULL) {
 		g_warning ("Calendar backend failed to parse a meeting");
+		exchange_mapi_util_free_stream_list (&streams);
+		exchange_mapi_util_free_recipient_list (&recipients);
+		exchange_mapi_util_free_attachment_list (&attachments);
 		return TRUE;
 	}
 
@@ -413,6 +415,9 @@
 	recurring = (const bool *)find_mapi_SPropValue_data(array, PROP_TAG(PT_BOOLEAN, 0x8223));
 	if (recurring && *recurring) {
 		g_warning ("Encountered a recurring event.");
+		exchange_mapi_util_free_stream_list (&streams);
+		exchange_mapi_util_free_recipient_list (&recipients);
+		exchange_mapi_util_free_attachment_list (&attachments);
 		return TRUE;
 	}
 
@@ -421,6 +426,9 @@
 	recurring = (const bool *)find_mapi_SPropValue_data(array, PROP_TAG(PT_BOOLEAN, 0x8126));
 	if (recurring && *recurring) {
 		g_warning ("Encountered a recurring task.");
+		exchange_mapi_util_free_stream_list (&streams);
+		exchange_mapi_util_free_recipient_list (&recipients);
+		exchange_mapi_util_free_attachment_list (&attachments);
 		return TRUE;
 	}
 
@@ -478,6 +486,9 @@
 	}
 
 	g_free (tmp);
+	exchange_mapi_util_free_stream_list (&streams);
+	exchange_mapi_util_free_recipient_list (&recipients);
+	exchange_mapi_util_free_attachment_list (&attachments);
 	return TRUE;
 }
 
@@ -846,6 +857,9 @@
 	/* FIXME: Provide support for meetings/assigned tasks */
 	if (recipients != NULL) {
 		g_warning ("Calendar backend failed to parse a meeting");
+		exchange_mapi_util_free_stream_list (&streams);
+		exchange_mapi_util_free_recipient_list (&recipients);
+		exchange_mapi_util_free_attachment_list (&attachments);
 		return TRUE;
 	}
 
@@ -855,6 +869,9 @@
 			recurring = (const bool *)find_mapi_SPropValue_data(properties, PROP_TAG(PT_BOOLEAN, 0x8223));
 			if (recurring && *recurring) {
 				g_warning ("Encountered a recurring event.");
+				exchange_mapi_util_free_stream_list (&streams);
+				exchange_mapi_util_free_recipient_list (&recipients);
+				exchange_mapi_util_free_attachment_list (&attachments);
 				return TRUE;
 			}
 			break;
@@ -863,6 +880,9 @@
 			recurring = (const bool *)find_mapi_SPropValue_data(properties, PROP_TAG(PT_BOOLEAN, 0x8126));
 			if (recurring && *recurring) {
 				g_warning ("Encountered a recurring task.");
+				exchange_mapi_util_free_stream_list (&streams);
+				exchange_mapi_util_free_recipient_list (&recipients);
+				exchange_mapi_util_free_attachment_list (&attachments);
 				return TRUE;
 			}
 			break;
@@ -886,6 +906,9 @@
 		g_object_unref (comp);
 	}
 
+	exchange_mapi_util_free_stream_list (&streams);
+	exchange_mapi_util_free_recipient_list (&recipients);
+	exchange_mapi_util_free_attachment_list (&attachments);
 	return TRUE;
 }
 
@@ -1845,9 +1868,6 @@
 	cbmapi->priv = priv;
 
 	e_cal_backend_sync_set_lock (E_CAL_BACKEND_SYNC (cbmapi), TRUE);
-
-	e_cal_backend_mapi_tz_util_populate ();
-	d(e_cal_backend_mapi_tz_util_dump ());
 }
 
 GType



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