Description: Cherry-pick of fix for recurring events, Ubuntu bug 513394
Origin: upstream, commit: f36cca5d32ce87a53684d950d53da75e266553ff,
  commit:fc48cc0ae6f74f9ca292969fa034da6c48f1e6ef
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=604029
Author: Milan Crha <mcrha@redhat.com>, Sean Finney <seanius@seanius.net>

=== modified file 'src/libexchangemapi/exchange-mapi-cal-recur-utils.c'
--- old/src/libexchangemapi/exchange-mapi-cal-recur-utils.c	2010-10-19 15:03:33 +0000
+++ new/src/libexchangemapi/exchange-mapi-cal-recur-utils.c	2011-02-11 23:36:57 +0000
@@ -656,8 +656,10 @@
 	/* some constant */
 	flag32 = *((guint32 *)ptr);
 	ptr += sizeof (guint32);
+	/* It should be set, but not must. It can be, technically, any value.
+	   Seen were 0x3006, 0x3008, 0x3009. It affects format of extended exception info
 	if (flag32 != WRITER_VERSION2)
-		return FALSE;
+		return FALSE; */
 
 	/* start time in mins */
 	flag32 = *((guint32 *)ptr);
@@ -670,20 +672,11 @@
 	/* modified exceptions */
 	flag16 = *((guint16 *)ptr);
 	ptr += sizeof (guint16);
-	if (flag16 != 0x0)
-		return FALSE;
-
-	/* reserved block1 size - has to be 0 */
-	flag32 = *((guint32 *)ptr);
-	ptr += sizeof (guint32);
-	if (flag32 != 0x0)
-		return FALSE;
-
-	/* reserved block2 size - has to be 0 */
-	flag32 = *((guint32 *)ptr);
-	ptr += sizeof (guint32);
-	if (flag32 != 0x0)
-		return FALSE;
+    /* FIXME: there are flag16 count modified exceptions here, which
+              are variable in size, followed by a ReservedBlock1{Size,}
+              and ReservedBlock2{Size,}.  However, since we have nothing 
+              else to do until we are able to parse these modified
+              instances, we just stop now. */
 
 	/* Set the recurrence */
 	{
@@ -698,11 +691,6 @@
 	/* FIXME: this also has modified instances */
 	e_cal_component_set_exdate_list (comp, exdate_list);
 
-	g_print ("\n== MAPI to ICAL == The recurrence blob data is as follows:\n");
-	for (i = 0; i < ba->len; ++i)
-		g_print ("0x%02X ", ba->data[i]);
-	g_print("\n== End of stream ==\n");
-
 	return TRUE;
 }
 

