evolution-data-server r8468 - in branches/EXCHANGE_MAPI_BRANCH: calendar/backends/mapi servers/mapi



Author: msuman
Date: Fri Feb  8 11:40:42 2008
New Revision: 8468
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=8468&view=rev

Log:
Bug fixes in preparation for initial testing

Modified:
   branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/ChangeLog
   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
   branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/tz-ical-to-mapi
   branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/tz-mapi-to-ical
   branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-connection.c

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	Fri Feb  8 11:40:42 2008
@@ -226,7 +226,7 @@
 	for (l = list_items, i = 0; l != NULL; l = l->next, ++i) 
 		g_print ("[%3d]\t%s\n", (i+1), (gchar *)(l->data));
 
-	icaltimezone_free_builtin_timezones ();
+//	icaltimezone_free_builtin_timezones ();
 
 	g_list_free (list_items);
 }

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	Fri Feb  8 11:40:42 2008
@@ -35,7 +35,9 @@
 #include "e-cal-backend-mapi.h"
 #include "e-cal-backend-mapi-utils.h"
 #include "e-cal-backend-mapi-tz-utils.h"
-
+#if 0
+#include "e-cal-backend-mapi-recur-utils.h"
+#endif
 /*
  * Priority
  */
@@ -88,6 +90,10 @@
 #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);
+
 static struct icaltimetype
 foo (const time_t tm, const int is_date, const icaltimezone *comp_zone)
 {
@@ -173,6 +179,10 @@
 	}
 
 	e_cal_component_set_attachment_list (comp, new_attach_list);
+
+	for (l = new_attach_list; l != NULL; l = l->next)
+		g_free (l->data);
+	g_slist_free (new_attach_list);
 }
 
 static void
@@ -213,6 +223,35 @@
 	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
+
+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;
+		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 ();
+	}
+}
+
+
 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)
@@ -334,7 +373,12 @@
 		b = (const bool *)find_mapi_SPropValue_data(properties, PROP_TAG(PT_BOOLEAN, 0x8223));
 		if (b && *b) {
 			/* FIXME: recurrence */
-		}
+			g_warning ("Encountered a recurring event.");
+/*			stream = exchange_mapi_util_find_stream (streams, PROP_TAG(PT_BINARY, 0x8216));
+			if (stream) {
+				e_cal_backend_mapi_util_bin_to_rrule (stream->value, comp);
+			}
+*/		} 
 
 		/* FIXME: the ALARM definitely needs more work */
 		b = (const bool *)find_mapi_SPropValue_data(properties, PROP_TAG(PT_BOOLEAN, 0x8503));
@@ -406,6 +450,7 @@
 		b = (const bool *)find_mapi_SPropValue_data(properties, PROP_TAG(PT_BOOLEAN, 0x8126));
 		if (b && *b) {
 			/* FIXME: Evolution does not support recurring tasks */
+			g_warning ("Encountered a recurring task.");
 		}
 
 		/* FIXME: the ALARM definitely needs more work */
@@ -490,8 +535,103 @@
 	return comp;
 }
 
-#define APPT_NAMED_PROPS_N  14
+#define COMMON_NAMED_PROPS_N 8
+
+typedef enum 
+{
+	I_COMMON_REMMINS = 0 , 
+	I_COMMON_REMTIME , 
+	I_COMMON_REMSET , 
+	I_COMMON_ISPRIVATE , 
+	I_COMMON_CTXMENUFLAGS , 
+	I_COMMON_START , 
+	I_COMMON_END , 
+	I_COMMON_REMNEXTTIME 
+} CommonNamedPropsIndex;
+
+gboolean
+build_name_id (struct mapi_nameid *nameid, gpointer data)
+{
+	ECalBackendMAPI *cbmapi	= E_CAL_BACKEND_MAPI (data);
+	icalcomponent_kind kind = e_cal_backend_get_kind (E_CAL_BACKEND (cbmapi));
+
+	/* NOTE: Avoid using mapi_nameid_OOM_add because: 
+	 * a) its inefficient (uses strcmp) 
+	 * b) names may vary in different server/libmapi versions 
+	 */
+
+	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
+
+	if (kind == ICAL_VEVENT_COMPONENT) 
+		appt_build_name_id (nameid);
+	else if (kind == ICAL_VTODO_COMPONENT)
+		task_build_name_id (nameid);
+	else if (kind == ICAL_VJOURNAL_COMPONENT)
+		note_build_name_id (nameid);
+
+	return TRUE;
+}
+
+/**
+ * NOTE: The enumerations '(Appt/Task/Note)NamedPropsIndex' have been defined 
+ * only to make life a little easier for developers. Here's the logic 
+ * behind the definition:
+     1) The first element is initialized with 'COMMON_NAMED_PROPS_N' : When 
+	adding named props, we add the common named props first and then the 
+	specific named props. So.. the index of the first specific 
+	named property = COMMON_NAMED_PROPS_N
+     2) The order in the enumeration 'must' be the same as that in the routine 
+	which adds the specific named props - (appt/task/note)_build_name_id
+     3) If a specific named prop is added/deleted, an index needs to
+	be created/deleted at the correct position. [Don't forget to update 
+	(APPT/TASK/NOTE)_NAMED_PROPS_N]. 
+
+ * To summarize the pros: 
+     1) Addition/deletion of a common-named-prop would not affect the indexes 
+	of the specific named props once COMMON_NAMED_PROPS_N is updated. 
+     2) Values of named props can be added in any order. 
+ */
+
+
+#define APPT_NAMED_PROPS_N  18
 #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 , 
+	I_APPT_END , 
+	I_APPT_DURATION , 
+	I_APPT_ALLDAY , 
+	I_APPT_RECURBLOB , 
+	I_APPT_MEETINGSTATUS , 
+//	I_APPT_RESPONSESTATUS , 
+	I_APPT_ISRECURRING , 
+	I_APPT_RECURBASE , 
+	I_APPT_RECURTYPE , 
+	I_APPT_RECURPATTERN , 
+	I_APPT_RECURSTART , 
+	I_APPT_RECUREND , 
+//	I_APPT_ALLATTENDEES , 
+//	I_APPT_TOATTENDEES , 
+//	I_APPT_CCATTENDEES , 
+	I_APPT_ISONLINEMEET , 
+	I_APPT_COUNTERPROPOSAL , 
+	I_APPT_STARTTZBLOB , 
+	I_APPT_ENDTZBLOB 
+//	I_APPT_LABEL , 
+//	I_APPT_DISPTZ 
+} ApptNamedPropsIndex;
+
 static void 
 appt_build_name_id (struct mapi_nameid *nameid)
 {
@@ -499,16 +639,16 @@
 	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, 0x825E, PSETID_Appointment); 	// PT_BINARY - (timezone for dtstart)
 	mapi_nameid_lid_add(nameid, 0x820E, PSETID_Appointment); 	// PT_SYSTIME - End/ApptEndWhole
-	mapi_nameid_lid_add(nameid, 0x825F, PSETID_Appointment); 	// PT_BINARY - (timezone for dtend)
 	mapi_nameid_lid_add(nameid, 0x8213, PSETID_Appointment); 	// PT_LONG - Duration/ApptDuration
 	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, 0x8223, PSETID_Appointment); 	// PT_BOOLEAN - IsRecurring/Recurring
-//	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, 0x8228, PSETID_Appointment); 	// PT_SYSTIME - RecurrenceBase
+	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, 0x8238, PSETID_Appointment); 	// PT_STRING8 - AllAttendees
@@ -516,14 +656,38 @@
 //	mapi_nameid_lid_add(nameid, 0x823C, PSETID_Appointment); 	// PT_STRING8 - CCAttendeesString (dupe PR_DISPLAY_CC)
 	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)
 
 	/* These probably would never be used from Evolution */
 //	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 DEFAULT_TASK_REMINDER_MINS 1080
+
+typedef enum 
+{
+	I_TASK_STATUS = COMMON_NAMED_PROPS_N , 
+	I_TASK_PERCENT , 
+//	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_ISRECURRING , 
+//	I_TASK_ROLE , 
+//	I_TASK_OWNERSHIP , 
+//	I_TASK_DELEGATIONSTATE , 
+//	I_TASK_ACTUALWORK , 
+//	I_TASK_TOTALWORK 
+} TaskNamedPropsIndex;
+
 static void 
 task_build_name_id (struct mapi_nameid *nameid)
 {
@@ -533,6 +697,7 @@
 	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
@@ -546,50 +711,34 @@
 //	mapi_nameid_lid_add(nameid, 0x8111, PSETID_Task); 	// PT_LONG - TotalWork/TaskEstimatedEffort
 }
 
+
 #define NOTE_NAMED_PROPS_N 0
+
+/*
+typedef enum 
+{
+//	I_NOTE_COLOR 
+} NoteNamedPropsIndex;
+*/
+
 static void 
 note_build_name_id (struct mapi_nameid *nameid)
 {
-
 	/* These probably would never be used from Evolution */
 //	mapi_nameid_lid_add(nameid, 0x8B00, PSETID_Note); 	// PT_LONG - Color
 }
 
-#define COMMON_NAMED_PROPS_N 7
-gboolean
-build_name_id (struct mapi_nameid *nameid, gpointer data)
-{
-	ECalBackendMAPI *cbmapi	= E_CAL_BACKEND_MAPI (data);
-	icalcomponent_kind kind = e_cal_backend_get_kind (E_CAL_BACKEND (cbmapi));
-
-	/* NOTE: Avoid using mapi_nameid_OOM_add because: 
-	 * a) its inefficient (uses strcmp) 
-	 * b) names may vary in different server/libmapi versions 
-	 */
-
-	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, 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
-
-	if (kind == ICAL_VEVENT_COMPONENT) 
-		appt_build_name_id (nameid);
-	else if (kind == ICAL_VTODO_COMPONENT)
-		task_build_name_id (nameid);
-	else if (kind == ICAL_VJOURNAL_COMPONENT)
-		note_build_name_id (nameid);
-
-	return TRUE;
-}
 
 #define MINUTES_IN_HOUR 60
 #define SECS_IN_MINUTE 60
 
 /* regular props count includes common named props */
 #define REGULAR_PROPS_N    COMMON_NAMED_PROPS_N + 11
+
+/** 
+ * NOTE: When a new regular property (PR_***) is added, 'REGULAR_PROPS_N' 
+ * should be updated. 
+ */
 int
 build_props (struct SPropValue **value, struct SPropTagArray *proptag_array, gpointer data)
 {
@@ -704,13 +853,13 @@
 		t.tv_sec = icaltime_as_timet (utc_dtstart) - (flag32 * SECS_IN_MINUTE);
 		t.tv_usec = 0;
 	}
-	set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[0], (const void *) &flag32);
-	set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[1], &t);
-	set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[2], (const void *) &b);
+	set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_REMMINS], (const void *) &flag32);
+	set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[I_COMMON_REMTIME], &t);
+	set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_REMSET], (const void *) &b);
 												/* prop count: 8 (no regular props added) */
 
 	/* ReminderNextTime: FIXME for recurrence */
-	set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[6], &t);
+	set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[I_COMMON_REMNEXTTIME], &t);
 
 	/* Sensitivity, Private */
 	flag32 = SENSITIVITY_NORMAL; 	/* default */
@@ -731,24 +880,26 @@
 				break;
 		}
 	set_SPropValue_proptag(&props[i++], PR_SENSITIVITY, (const void *) &flag32); 		/* prop count: 9 */
-	set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[3], (const void *) &b);
+	set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_ISPRIVATE], (const void *) &b);
 
 	t.tv_sec = icaltime_as_timet (utc_dtstart);
 	t.tv_usec = 0;
-	set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[4], &t);
+	set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[I_COMMON_START], &t);
 	set_SPropValue_proptag_date_timeval(&props[i++], PR_START_DATE, &t); 			/* prop count: 10 */
 
 	t.tv_sec = icaltime_as_timet (utc_dtend);
 	t.tv_usec = 0;
-	set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[5], &t);
+	set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[I_COMMON_END], &t);
 	set_SPropValue_proptag_date_timeval(&props[i++], PR_END_DATE, &t); 			/* prop count: 11 */
 
-	/* INFO: Index of last added named prop: 6 */
-
 	if (kind == ICAL_VEVENT_COMPONENT) {
 		const char *mapi_tzid;
 		struct SBinary start_tz, end_tz; 
 
+		/* Context menu flags */
+		flag32 = 369; 
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_CTXMENUFLAGS], (const void *) &flag32);
+
 		/* Busy Status */
 		flag32 = BUSY_STATUS_BUSY; 	/* default */
 		prop = icalcomponent_get_first_property (ical_comp, ICAL_TRANSP_PROPERTY);
@@ -766,67 +917,67 @@
 				default:
 					break;
 			}
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[7], (const void *) &flag32);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_BUSYSTATUS], (const void *) &flag32);
 
 		/* Location */
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[8], (const void *) icalcomponent_get_location (ical_comp));
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_LOCATION], (const void *) icalcomponent_get_location (ical_comp));
 
 		/* Start */
 		t.tv_sec = icaltime_as_timet (utc_dtstart);
 		t.tv_usec = 0;
-		set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[9], &t);
-		/* FIXME for recurrence */
-		set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[17], &t);
+		set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[I_APPT_START], &t);
 
 		/* Start TZ */
 		mapi_tzid = e_cal_backend_mapi_tz_util_get_mapi_equivalent ((dtstart_tzid && *dtstart_tzid) ? dtstart_tzid : "UTC");
 		if (mapi_tzid && *mapi_tzid) {
 			e_cal_backend_mapi_util_mapi_tz_to_bin (mapi_tzid, &start_tz);
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[10], (const void *) &start_tz);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_STARTTZBLOB], (const void *) &start_tz);
 		}
 
 		/* End */
 		t.tv_sec = icaltime_as_timet (utc_dtend);
 		t.tv_usec = 0;
-		set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[11], &t);
-		/* FIXME for recurrence */
-		set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[18], &t);
+		set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[I_APPT_END], &t);
 
 		/* End TZ */
 		mapi_tzid = e_cal_backend_mapi_tz_util_get_mapi_equivalent ((dtend_tzid && *dtend_tzid) ? dtend_tzid : "UTC");
 		if (mapi_tzid && *mapi_tzid) {
 			e_cal_backend_mapi_util_mapi_tz_to_bin (mapi_tzid, &end_tz);
-			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[12], (const void *) &end_tz);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_ENDTZBLOB], (const void *) &end_tz);
 		}
 
 		/* Duration */
 		flag32 = icaldurationtype_as_int (icaltime_subtract (dtend, dtstart));
 		flag32 /= MINUTES_IN_HOUR;
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[13], (const void *) &flag32);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_DURATION], (const void *) &flag32);
 
 		/* All-day event */
 		b = (icaltime_is_date (dtstart) && icaltime_is_date (dtend));
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[14], (const void *) &b);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_ALLDAY], (const void *) &b);
 
 		/* Meeting status */
 		flag32 = e_cal_component_has_attendees (comp);
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[15], (const void *) &flag32);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_MEETINGSTATUS], (const void *) &flag32);
 
 		/* Recurring */
 		b = e_cal_component_has_recurrences (comp);
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[16], (const void *) &b);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_ISRECURRING], (const void *) &b);
 
 		/* Online Meeting : we probably would never support this */
 		b = 0;
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[19], (const void *) &b);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_ISONLINEMEET], (const void *) &b);
 
 		/* Counter Proposal for appointments : not supported as of now */
 		b = 0;
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[20], (const void *) &b);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_COUNTERPROPOSAL], (const void *) &b);
 
 	} else if (kind == ICAL_VTODO_COMPONENT) {
 		double d;
 
+		/* Context menu flags */ /* FIXME: for assigned tasks */
+		flag32 = 272; 
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_CTXMENUFLAGS], (const void *) &flag32);
+
 		/* Status, Percent complete, IsComplete */
 		flag32 = olTaskNotStarted; 	/* default */
 		b = 0; 				/* default */
@@ -852,9 +1003,9 @@
 				break;
 		}
 
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[7], (const void *) &flag32);
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[8], (const void *) &d);
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[12], (const void *) &b);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_TASK_STATUS], (const void *) &flag32);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_TASK_PERCENT], (const void *) &d);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_TASK_ISCOMPLETE], (const void *) &b);
 
 		/* Date completed */
 		if (b) {
@@ -864,24 +1015,28 @@
 
 			t.tv_sec = icaltime_as_timet (completed);
 			t.tv_usec = 0;
-			set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[11], &t);
+			set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[I_TASK_COMPLETED], &t);
 		}
 
 		/* Start */
 		t.tv_sec = icaltime_as_timet (dtstart);
 		t.tv_usec = 0;
-		set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[9], &t);
+		set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[I_TASK_START], &t);
 
 		/* Due */
 		t.tv_sec = icaltime_as_timet (dtend);
 		t.tv_usec = 0;
-		set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[10], &t);
+		set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[I_TASK_DUE], &t);
 
 		/* FIXME: Evolution does not support recurring tasks */
 		b = 0;
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[13], (const void *) &b);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_TASK_ISRECURRING], (const void *) &b);
 
 	} else if (kind == ICAL_VJOURNAL_COMPONENT) {
+		/* Context menu flags */
+		flag32 = 272; 
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_CTXMENUFLAGS], (const void *) &flag32);
+
 	}
 
 	*value = props;

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	Fri Feb  8 11:40:42 2008
@@ -27,7 +27,7 @@
 
 #define gmtime_r(tp,tmp) (gmtime(tp)?(*(tmp)=*gmtime(tp),(tmp)):0)
 
-#define d(x)
+#define d(x) x
 
 static ECalBackendClass *parent_class = NULL;
 
@@ -35,6 +35,10 @@
 struct _ECalBackendMAPIPrivate {
 	mapi_id_t 		fid;
 	uint32_t 		olFolder;
+	char 			*owner_name;
+	char 			*owner_email;	
+	char			*user_name;
+	char			*user_email;
 
 	/* A mutex to control access to the private structure */
 	GMutex			*mutex;
@@ -56,7 +60,6 @@
 	/* timeout handler for syncing sendoptions */
 	guint			sendoptions_sync_timeout;
 	
-	char			*user_email;
 	char			*local_attachments_store;
 
 	/* used exclusively for delta fetching */
@@ -170,7 +173,7 @@
 	g_free (priv);
 	cbmapi->priv = NULL;
 
-	e_cal_backend_mapi_tz_util_destroy ();
+//	e_cal_backend_mapi_tz_util_destroy ();
 
 	if (G_OBJECT_CLASS (parent_class)->finalize)
 		(* G_OBJECT_CLASS (parent_class)->finalize) (object);
@@ -232,19 +235,21 @@
 	/* FIXME: what else ? */
 
 	*capabilities = g_strdup (
-//				CAL_STATIC_CAPABILITY_NO_ALARM_REPEAT ","
+				CAL_STATIC_CAPABILITY_NO_ALARM_REPEAT ","
 				CAL_STATIC_CAPABILITY_NO_AUDIO_ALARMS ","
 //				CAL_STATIC_CAPABILITY_NO_DISPLAY_ALARMS ","
 				CAL_STATIC_CAPABILITY_NO_EMAIL_ALARMS ","
 				CAL_STATIC_CAPABILITY_NO_PROCEDURE_ALARMS ","
+				CAL_STATIC_CAPABILITY_ONE_ALARM_ONLY ","
+				CAL_STATIC_CAPABILITY_REMOVE_ALARMS ","
+
+//				CAL_STATIC_CAPABILITY_NO_SHARED_MEMOS ","
 //				CAL_STATIC_CAPABILITY_NO_TASK_ASSIGNMENT ","
 				CAL_STATIC_CAPABILITY_NO_THISANDFUTURE ","
 				CAL_STATIC_CAPABILITY_NO_THISANDPRIOR ","
 //				CAL_STATIC_CAPABILITY_NO_TRANSPARENCY ","
-//				CAL_STATIC_CAPABILITY_ONE_ALARM_ONLY ","
 				CAL_STATIC_CAPABILITY_ORGANIZER_MUST_ATTEND ","
 //				CAL_STATIC_CAPABILITY_ORGANIZER_NOT_EMAIL_ADDRESS ","
-//				CAL_STATIC_CAPABILITY_REMOVE_ALARMS ","
 //				CAL_STATIC_CAPABILITY_SAVE_SCHEDULES ","
 				CAL_STATIC_CAPABILITY_NO_CONV_TO_ASSIGN_TASK ","
 				CAL_STATIC_CAPABILITY_NO_CONV_TO_RECUR ","
@@ -255,13 +260,13 @@
 //				CAL_STATIC_CAPABILITY_DELEGATE_SUPPORTED ","
 //				CAL_STATIC_CAPABILITY_NO_ORGANIZER ","
 //				CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY ","
-				CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING
+//				CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING
 				  );
 
 	return GNOME_Evolution_Calendar_Success;
 }
 
-static ECalBackendSyncStatus 
+static ECalBackendSyncStatus 	
 e_cal_backend_mapi_remove (ECalBackendSync *backend, EDataCal *cal)
 {
 	ECalBackendMAPI *cbmapi;
@@ -313,6 +318,25 @@
 	PR_SENSITIVITY, 
 	PR_START_DATE, 
 	PR_END_DATE
+/*
+	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_ADDRTYPE, 
+	PR_SENDER_EMAIL_ADDRESS, 
+
+	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 const uint16_t n_GetPropsList = G_N_ELEMENTS (GetPropsList);
 
@@ -327,20 +351,26 @@
 	const bool *recurring;
 
 	/* FIXME: Provide support for meetings/assigned tasks */
-	if (recipients != NULL)
+	if (recipients != NULL) {
+		g_warning ("Calendar backend failed to parse a meeting");
 		return TRUE;
+	}
 
 	recurring = NULL;
 	/* FIXME: Provide backend support for recurrence for appointments/meetings */
 	recurring = (const bool *)find_mapi_SPropValue_data(array, PROP_TAG(PT_BOOLEAN, 0x8223));
-	if (recurring && *recurring)
+	if (recurring && *recurring) {
+		g_warning ("Encountered a recurring event.");
 		return TRUE;
+	}
 
 	recurring = NULL;
 	/* FIXME: Evolution does not support recurring tasks */
 	recurring = (const bool *)find_mapi_SPropValue_data(array, PROP_TAG(PT_BOOLEAN, 0x8126));
-	if (recurring && *recurring)
+	if (recurring && *recurring) {
+		g_warning ("Encountered a recurring task.");
 		return TRUE;
+	}
 
 	tmp = exchange_mapi_util_mapi_id_to_string (mid);
 	cache_comp_uid = g_slist_find_custom (priv->cache_keys, tmp, (GCompareFunc) (g_ascii_strcasecmp));
@@ -590,21 +620,27 @@
 	const bool *recurring = NULL;
 
 	/* FIXME: Provide support for meetings/assigned tasks */
-	if (recipients != NULL)
+	if (recipients != NULL) {
+		g_warning ("Calendar backend failed to parse a meeting");
 		return TRUE;
+	}
 
 	switch (e_cal_backend_get_kind (E_CAL_BACKEND (cbmapi))) {
 		case ICAL_VEVENT_COMPONENT:
 			/* FIXME: Provide backend support for recurrence */
 			recurring = (const bool *)find_mapi_SPropValue_data(properties, PROP_TAG(PT_BOOLEAN, 0x8223));
-			if (recurring && *recurring)
+			if (recurring && *recurring) {
+				g_warning ("Encountered a recurring event.");
 				return TRUE;
+			}
 			break;
 		case ICAL_VTODO_COMPONENT:
 			/* FIXME: Evolution does not support recurring tasks */
 			recurring = (const bool *)find_mapi_SPropValue_data(properties, PROP_TAG(PT_BOOLEAN, 0x8126));
-			if (recurring && *recurring)
+			if (recurring && *recurring) {
+				g_warning ("Encountered a recurring task.");
 				return TRUE;
+			}
 			break;
 		case ICAL_VJOURNAL_COMPONENT:
 			break;
@@ -710,8 +746,11 @@
 
 	g_mutex_lock (priv->mutex);
 
-	/* do I have to check the incoming sexp ? */
-	search_needed = FALSE;
+//	d(g_message (G_STRLOC ": Getting object list (%s)", sexp));
+
+	if (!strcmp (sexp, "#t"))
+		search_needed = FALSE;
+
 	cbsexp = e_cal_backend_sexp_new (sexp);
 
 	if (!cbsexp) {

Modified: branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/tz-ical-to-mapi
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/tz-ical-to-mapi	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/tz-ical-to-mapi	Fri Feb  8 11:40:42 2008
@@ -196,17 +196,17 @@
 /softwarestudio.org/Tzfile/Arctic/Longyearbyen~~~Central Europe Standard Time
 /softwarestudio.org/Tzfile/Asia/Aden~~~Arab Standard Time
 /softwarestudio.org/Tzfile/Asia/Almaty~~~N. Central Asia Standard Time
-/softwarestudio.org/Tzfile/Asia/Amman~~~Israel Standard Time
+/softwarestudio.org/Tzfile/Asia/Amman~~~Jordan Standard Time
 /softwarestudio.org/Tzfile/Asia/Anadyr~~~Fiji Standard Time
 /softwarestudio.org/Tzfile/Asia/Aqtau~~~Ekaterinburg Standard Time
 /softwarestudio.org/Tzfile/Asia/Aqtobe~~~Ekaterinburg Standard Time
 /softwarestudio.org/Tzfile/Asia/Ashgabat~~~Ekaterinburg Standard Time
 /softwarestudio.org/Tzfile/Asia/Baghdad~~~Arabic Standard Time
 /softwarestudio.org/Tzfile/Asia/Bahrain~~~Arab Standard Time
-/softwarestudio.org/Tzfile/Asia/Baku~~~Caucasus Standard Time
+/softwarestudio.org/Tzfile/Asia/Baku~~~Azerbaijan Standard Time
 /softwarestudio.org/Tzfile/Asia/Bangkok~~~SE Asia Standard Time
 /softwarestudio.org/Tzfile/Asia/Beijing~~~China Standard Time
-/softwarestudio.org/Tzfile/Asia/Beirut~~~Israel Standard Time
+/softwarestudio.org/Tzfile/Asia/Beirut~~~Middle East Standard Time
 /softwarestudio.org/Tzfile/Asia/Bishkek~~~Central Asia Standard Time
 /softwarestudio.org/Tzfile/Asia/Brunei~~~Taipei Standard Time
 /softwarestudio.org/Tzfile/Asia/Calcutta~~~India Standard Time
@@ -296,7 +296,7 @@
 /softwarestudio.org/Tzfile/Europe/Amsterdam~~~W. Europe Standard Time
 /softwarestudio.org/Tzfile/Europe/Andorra~~~W. Europe Standard Time
 /softwarestudio.org/Tzfile/Europe/Athens~~~GTB Standard Time
-/softwarestudio.org/Tzfile/Europe/Belgrade~~~Central Europe Standard Time
+/softwarestudio.org/Tzfile/Europe/Belgrade~~~Central European Standard Time
 /softwarestudio.org/Tzfile/Europe/Berlin~~~W. Europe Standard Time
 /softwarestudio.org/Tzfile/Europe/Bratislava~~~Central Europe Standard Time
 /softwarestudio.org/Tzfile/Europe/Brussels~~~Romance Standard Time
@@ -366,7 +366,7 @@
 /softwarestudio.org/Tzfile/Pacific/Efate~~~Central Pacific Standard Time
 /softwarestudio.org/Tzfile/Pacific/Enderbury~~~Tonga Standard Time
 /softwarestudio.org/Tzfile/Pacific/Fakaofo~~~Hawaiian Standard Time
-/softwarestudio.org/Tzfile/Pacific/Fiji~~~Central Pacific Standard Time
+/softwarestudio.org/Tzfile/Pacific/Fiji~~~Fiji Standard Time
 /softwarestudio.org/Tzfile/Pacific/Funafuti~~~Fiji Standard Time
 /softwarestudio.org/Tzfile/Pacific/Galapagos~~~Mexico Standard Time
 /softwarestudio.org/Tzfile/Pacific/Gambier~~~Alaskan Standard Time

Modified: branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/tz-mapi-to-ical
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/tz-mapi-to-ical	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/tz-mapi-to-ical	Fri Feb  8 11:40:42 2008
@@ -12,7 +12,7 @@
 Central Standard Time~~~/softwarestudio.org/Tzfile/America/Chicago
 Central Standard Time (Mexico)~~~/softwarestudio.org/Tzfile/America/Monterrey
 Mexico Standard Time~~~/softwarestudio.org/Tzfile/America/Mexico_City
-Canada Central Standard Time~~~/softwarestudio.org/Tzfile/America/Regina
+Canada Central Standard Time~~~/softwarestudio.org/Tzfile/America/Winnipeg
 SA Pacific Standard Time~~~/softwarestudio.org/Tzfile/America/Bogota
 Eastern Standard Time~~~/softwarestudio.org/Tzfile/America/New_York
 US Eastern Standard Time~~~/softwarestudio.org/Tzfile/America/Indiana/Indianapolis

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	Fri Feb  8 11:40:42 2008
@@ -894,7 +894,7 @@
 		}
 
 		if (has_attach && *has_attach) {
-			printf("%s(%d):%s:Fetching Attachments \n", __FILE__, __LINE__, __PRETTY_FUNCTION__);
+			g_print ("%s(%d): %s: Fetching Attachments \n", __FILE__, __LINE__, __PRETTY_FUNCTION__);
 			exchange_mapi_util_get_attachments (&obj_message, &attach_list);
 		}
 



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