evolution-data-server r9062 - in branches/EXCHANGE_MAPI_BRANCH: addressbook/backends/galldap addressbook/backends/mapi calendar/backends/mapi camel/providers/mapi servers/mapi



Author: msuman
Date: Sun Jun 29 06:04:50 2008
New Revision: 9062
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9062&view=rev

Log:
API changes in fetch_item, fetch_items and FetchCallback, related fixes, Initial support for viewing/creating meetings, blanket update of Novell copyright notices and licenses.

Modified:
   branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/galldap/e-book-backend-galldap-factory.c
   branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/galldap/e-book-backend-galldap-factory.h
   branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/galldap/e-book-backend-galldap.c
   branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/galldap/e-book-backend-galldap.h
   branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/mapi/ChangeLog
   branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/mapi/e-book-backend-mapi-factory.c
   branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/mapi/e-book-backend-mapi.c
   branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/mapi/e-book-backend-mapi.h
   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-factory.h
   branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-recur-utils.c
   branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-recur-utils.h
   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.h
   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.h
   branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi.c
   branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi.h
   branches/EXCHANGE_MAPI_BRANCH/camel/providers/mapi/ChangeLog
   branches/EXCHANGE_MAPI_BRANCH/camel/providers/mapi/camel-mapi-folder.c
   branches/EXCHANGE_MAPI_BRANCH/servers/mapi/ChangeLog
   branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-connection.c
   branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-connection.h
   branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-defs.h
   branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-folder.c
   branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-folder.h
   branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-utils.c
   branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-utils.h

Modified: branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/galldap/e-book-backend-galldap-factory.c
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/galldap/e-book-backend-galldap-factory.c	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/galldap/e-book-backend-galldap-factory.c	Sun Jun 29 06:04:50 2008
@@ -1,21 +1,21 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/* Copyright (C) 2002-2004 Novell, Inc.
- * 
+/*
+ *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ *
  *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version. 
+ *  it under the terms of version 2 of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation.
+ *
+ *  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 Lesser General Public License for more details.
  *
- * 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 Lesser General Public 
+ *  License along with this program; if not, write to: 
+ *  Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
  *
- * 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., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
  */
 
 #ifdef HAVE_CONFIG_H

Modified: branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/galldap/e-book-backend-galldap-factory.h
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/galldap/e-book-backend-galldap-factory.h	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/galldap/e-book-backend-galldap-factory.h	Sun Jun 29 06:04:50 2008
@@ -1,21 +1,21 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/* Copyright (C) 2007 Novell, Inc.
- * 
+/*
+ *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ *
  *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version. 
+ *  it under the terms of version 2 of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation.
+ *
+ *  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 Lesser General Public License for more details.
  *
- * 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 Lesser General Public 
+ *  License along with this program; if not, write to: 
+ *  Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
  *
- * 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., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
  */
 
 

Modified: branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/galldap/e-book-backend-galldap.c
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/galldap/e-book-backend-galldap.c	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/galldap/e-book-backend-galldap.c	Sun Jun 29 06:04:50 2008
@@ -1,20 +1,21 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/* Copyright (C) 2000-2004 Novell, Inc.
+/*
+ *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of version 2 of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
+ *  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 Lesser General Public License for more details.
  *
- * 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 Lesser General Public 
+ *  License along with this program; if not, write to: 
+ *  Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
  *
- * 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., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
  */
 
 #undef G_LOG_DOMAIN

Modified: branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/galldap/e-book-backend-galldap.h
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/galldap/e-book-backend-galldap.h	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/galldap/e-book-backend-galldap.h	Sun Jun 29 06:04:50 2008
@@ -1,21 +1,21 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/* Copyright (C) 2007 Novell, Inc.
- * 
+/*
+ *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ *
  *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Lesser General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version. 
+ *  it under the terms of version 2 of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation.
+ *
+ *  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 Lesser General Public License for more details.
  *
- * 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 Lesser General Public 
+ *  License along with this program; if not, write to: 
+ *  Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
  *
- * 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., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
  */
 
 #ifndef __E_BOOK_BACKEND_GALLDAP_H__

Modified: branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/mapi/e-book-backend-mapi-factory.c
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/mapi/e-book-backend-mapi-factory.c	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/mapi/e-book-backend-mapi-factory.c	Sun Jun 29 06:04:50 2008
@@ -1,21 +1,24 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ *  Authors: 
+ *    Srinivasa Ragavan <sragavan novell com>
  *
- *  Srinivasa Ragavan <sragavan novell com>
- *  Copyright (C) 2007 Novell, Inc.
+ *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  *
  *  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.
+ *  it under the terms of version 2 of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation.
  *
  *  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.
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public 
+ *  License along with this program; if not, write to: 
+ *  Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
  *
- *  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.
  */
 
 

Modified: branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/mapi/e-book-backend-mapi.c
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/mapi/e-book-backend-mapi.c	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/mapi/e-book-backend-mapi.c	Sun Jun 29 06:04:50 2008
@@ -1,21 +1,24 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ *  Authors: 
+ *    Srinivasa Ragavan <sragavan novell com>
  *
- *  Srinivasa Ragavan <sragavan novell com>
- *  Copyright (C) 2007 Novell, Inc.
+ *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  *
  *  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.
+ *  it under the terms of version 2 of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation.
  *
  *  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.
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public 
+ *  License along with this program; if not, write to: 
+ *  Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
  *
- *  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.
  */
 
 
@@ -365,9 +368,6 @@
 
 	mapi_nameid_lid_add(nameid, 0x8094, PSETID_Address);
 	mapi_nameid_lid_add(nameid, 0x80A4, PSETID_Address);
-	
-
-	printf("NAMMMMMMMMMMMM %d\n", nameid->count);
 
 	return TRUE;
 }
@@ -671,8 +671,8 @@
 	}
 }
 
-static gpointer
-create_contact_item (struct mapi_SPropValue_array *array, mapi_id_t fid, mapi_id_t mid, GSList *streams, GSList *recipients, GSList *attachments)
+static gboolean
+create_contact_item (struct mapi_SPropValue_array *array, mapi_id_t fid, mapi_id_t mid, GSList *streams, GSList *recipients, GSList *attachments, gpointer data)
 {
 	EContact *contact;
 	char *suid;
@@ -682,11 +682,13 @@
 	printf("got contact %s\n", suid);
 	if (contact) {
 		/* UID of the contact is nothing but the concatenated string of hex id of folder and the message.*/
-		e_contact_set (contact, E_CONTACT_UID, suid);		
+		e_contact_set (contact, E_CONTACT_UID, suid);
+		data = contact;
 	}
 
 	g_free (suid);
-	return (gpointer) contact;
+
+	return TRUE;
 }
 
 static void
@@ -748,7 +750,11 @@
 			mapi_id_t fid, mid;
 			
 			exchange_mapi_util_mapi_ids_from_uid (id, &fid, &mid);
-			contact = exchange_mapi_connection_fetch_item (priv->fid, mid, NULL, 0, NULL, create_contact_item, NULL, MAPI_OPTIONS_FETCH_ALL);
+			exchange_mapi_connection_fetch_item (priv->fid, mid, 
+							NULL, 0, 
+							NULL, NULL, 
+							create_contact_item, contact, 
+							MAPI_OPTIONS_FETCH_ALL);
 
 			if (contact) {
 				e_contact_set (contact, E_CONTACT_BOOK_URI, priv->uri);
@@ -896,9 +902,11 @@
 				return ;				
 			}
 
-			if (!exchange_mapi_connection_fetch_items (priv->fid, 
-								GetPropsList, n_GetPropsList, mapi_book_build_name_id_for_getprops, 
-								   &res, create_contact_list_cb, &vcard_str, MAPI_OPTIONS_FETCH_ALL)) {
+			if (!exchange_mapi_connection_fetch_items (priv->fid, &res, 
+								GetPropsList, n_GetPropsList, 
+								mapi_book_build_name_id_for_getprops, NULL, 
+								create_contact_list_cb, &vcard_str, 
+								MAPI_OPTIONS_FETCH_ALL)) {
 				e_data_book_respond_get_contact_list (book, opid, GNOME_Evolution_Addressbook_OtherError, NULL);
 				return ;
 			}
@@ -1285,7 +1293,11 @@
 
 		//FIXME: We need to fetch only the query from the server live and not everything.
 		/* execute the query */
-		if (!exchange_mapi_connection_fetch_items (priv->fid, NULL, 0, NULL, NULL, create_contact_cb, book_view, MAPI_OPTIONS_FETCH_ALL)) {
+		if (!exchange_mapi_connection_fetch_items (priv->fid, NULL, 
+							NULL, 0, 
+							NULL, NULL, 
+							create_contact_cb, book_view, 
+							MAPI_OPTIONS_FETCH_ALL)) {
 			if (e_flag_is_set (closure->running))
 				e_data_book_view_notify_complete (book_view, 
 								  GNOME_Evolution_Addressbook_OtherError);	
@@ -1388,7 +1400,11 @@
 	
 	e_file_cache_freeze_changes (E_FILE_CACHE (priv->cache));
 	
-	if (!exchange_mapi_connection_fetch_items (priv->fid, NULL, 0, NULL, NULL, cache_contact_cb, ebmapi, MAPI_OPTIONS_FETCH_ALL)) {
+	if (!exchange_mapi_connection_fetch_items (priv->fid, NULL, 
+						NULL, 0, 
+						NULL, NULL, 
+						cache_contact_cb, ebmapi, 
+						MAPI_OPTIONS_FETCH_ALL)) {
 		printf("Error during caching addressbook\n");
 		e_file_cache_thaw_changes (E_FILE_CACHE (priv->cache));
 		return NULL;
@@ -1430,7 +1446,11 @@
 	
 	e_file_cache_freeze_changes (E_FILE_CACHE (priv->cache));
 	
-	if (!exchange_mapi_connection_fetch_items ( priv->fid, NULL, 0, NULL, &res, cache_contact_cb,ebmapi, MAPI_OPTIONS_FETCH_ALL)) {
+	if (!exchange_mapi_connection_fetch_items ( priv->fid, &res, 
+						NULL, 0, 
+						NULL, NULL, 
+						cache_contact_cb, ebmapi, 
+						MAPI_OPTIONS_FETCH_ALL)) {
 		printf("Error during caching addressbook\n");
 		e_file_cache_thaw_changes (E_FILE_CACHE (priv->cache));
 		return NULL;

Modified: branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/mapi/e-book-backend-mapi.h
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/mapi/e-book-backend-mapi.h	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/addressbook/backends/mapi/e-book-backend-mapi.h	Sun Jun 29 06:04:50 2008
@@ -1,21 +1,24 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ *  Authors: 
+ *    Srinivasa Ragavan <sragavan novell com>
  *
- *  Srinivasa Ragavan <sragavan novell com>
- *  Copyright (C) 2007 Novell, Inc.
+ *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  *
  *  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.
+ *  it under the terms of version 2 of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation.
  *
  *  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.
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public 
+ *  License along with this program; if not, write to: 
+ *  Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
  *
- *  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_BOOK_BACKEND_MAPI_H__

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	Sun Jun 29 06:04:50 2008
@@ -1,21 +1,24 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ *  Authors: 
+ *    Suman Manjunath <msuman novell com>
  *
- *  Suman Manjunath <msuman novell com>
- *  Copyright (C) 2007 Novell, Inc.
+ *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  *
  *  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.
+ *  it under the terms of version 2 of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation.
  *
  *  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.
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public 
+ *  License along with this program; if not, write to: 
+ *  Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
  *
- *  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.
  */
 
 

Modified: branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-factory.h
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-factory.h	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-factory.h	Sun Jun 29 06:04:50 2008
@@ -1,21 +1,24 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ *  Authors: 
+ *    Suman Manjunath <msuman novell com>
  *
- *  Suman Manjunath <msuman novell com>
- *  Copyright (C) 2007 Novell, Inc.
+ *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  *
  *  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.
+ *  it under the terms of version 2 of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation.
  *
  *  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.
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public 
+ *  License along with this program; if not, write to: 
+ *  Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
  *
- *  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.
  */
 
 
@@ -23,8 +26,7 @@
 #ifndef _E_CAL_BACKEND_MAPI_FACTORY_H_
 #define _E_CAL_BACKEND_MAPI_FACTORY_H_
 
-#include <glib-object.h>
-#include "libedata-cal/e-cal-backend-factory.h"
+#include <libedata-cal/e-cal-backend-factory.h>
 
 G_BEGIN_DECLS
 
@@ -35,3 +37,4 @@
 G_END_DECLS
 
 #endif /* _E_CAL_BACKEND_MAPI_FACTORY_H_ */
+

Modified: branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-recur-utils.c
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-recur-utils.c	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-recur-utils.c	Sun Jun 29 06:04:50 2008
@@ -1,21 +1,24 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ *  Authors: 
+ *    Suman Manjunath <msuman novell com>
  *
- *  Suman Manjunath <msuman novell com>
- *  Copyright (C) 2007 Novell, Inc.
+ *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  *
  *  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.
+ *  it under the terms of version 2 of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation.
  *
  *  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.
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public 
+ *  License along with this program; if not, write to: 
+ *  Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
  *
- *  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.
  */
 
 

Modified: branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-recur-utils.h
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-recur-utils.h	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-recur-utils.h	Sun Jun 29 06:04:50 2008
@@ -1,21 +1,24 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ *  Authors: 
+ *    Suman Manjunath <msuman novell com>
  *
- *  Suman Manjunath <msuman novell com>
- *  Copyright (C) 2007 Novell, Inc.
+ *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  *
  *  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.
+ *  it under the terms of version 2 of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation.
  *
  *  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.
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public 
+ *  License along with this program; if not, write to: 
+ *  Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
  *
- *  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.
  */
 
 

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	Sun Jun 29 06:04:50 2008
@@ -1,21 +1,24 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ *  Authors: 
+ *    Suman Manjunath <msuman novell com>
  *
- *  Suman Manjunath <msuman novell com>
- *  Copyright (C) 2007 Novell, Inc.
+ *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  *
  *  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.
+ *  it under the terms of version 2 of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation.
  *
  *  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.
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public 
+ *  License along with this program; if not, write to: 
+ *  Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
  *
- *  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.
  */
 
 

Modified: branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-tz-utils.h
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-tz-utils.h	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-tz-utils.h	Sun Jun 29 06:04:50 2008
@@ -1,21 +1,24 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ *  Authors: 
+ *    Suman Manjunath <msuman novell com>
  *
- *  Suman Manjunath <msuman novell com>
- *  Copyright (C) 2007 Novell, Inc.
+ *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  *
  *  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.
+ *  it under the terms of version 2 of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation.
  *
  *  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.
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public 
+ *  License along with this program; if not, write to: 
+ *  Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
  *
- *  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.
  */
 
 

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	Sun Jun 29 06:04:50 2008
@@ -1,21 +1,24 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ *  Authors: 
+ *    Suman Manjunath <msuman novell com>
  *
- *  Suman Manjunath <msuman novell com>
- *  Copyright (C) 2007 Novell, Inc.
+ *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  *
  *  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.
+ *  it under the terms of version 2 of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation.
  *
  *  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.
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public 
+ *  License along with this program; if not, write to: 
+ *  Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
  *
- *  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.
  */
 
 
@@ -39,6 +42,8 @@
 #include "e-cal-backend-mapi-recur-utils.h"
 #endif
 
+#define d(x) 
+
 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);
@@ -172,9 +177,8 @@
 	e_cal_component_set_attachment_list (comp, comp_attach_list);
 }
 
-#define PARTICIPANT 	0x2
-#define MEET_ORGANIZER 	PARTICIPANT << 0x0
-#define MEET_ATTENDEE  	PARTICIPANT << 0x8
+#define RECIP_SENDABLE  0x1
+#define RECIP_ORGANIZER 0x2
 
 static icalparameter_role
 get_role_from_type (OlMailRecipientType type)
@@ -188,6 +192,18 @@
 	}
 }
 
+static OlMailRecipientType
+get_type_from_role (icalparameter_role role)
+{
+	switch (role) {
+		case ICAL_ROLE_CHAIR 		:
+		case ICAL_ROLE_REQPARTICIPANT 	:
+		case ICAL_ROLE_NONPARTICIPANT 	: return olTo;
+		case ICAL_ROLE_OPTPARTICIPANT 	: return olCC;
+		default 			: return olTo;
+	}
+} 
+
 static icalparameter_partstat
 get_partstat_from_trackstatus (uint32_t trackstatus)
 {
@@ -199,8 +215,57 @@
 	}
 }
 
+static uint32_t 
+get_trackstatus_from_partstat (icalparameter_partstat partstat)
+{
+	switch (partstat) {
+		case ICAL_PARTSTAT_TENTATIVE 	: return olMeetingTentative;
+		case ICAL_PARTSTAT_ACCEPTED 	: return olMeetingAccepted;
+		case ICAL_PARTSTAT_DECLINED 	: return olMeetingDeclined;
+		default 			: return olMeetingTentative;
+	}
+}
+
+void
+e_cal_backend_mapi_util_fetch_recipients (ECalBackendMAPI *cbmapi, ECalComponent *comp, GSList **recip_list)
+{
+	GSList *al = NULL, *l;
+
+	e_cal_component_get_attendee_list (comp, &al);
+
+	for (l = al; l != NULL; l = l->next) {
+		ECalComponentAttendee *attendee = (ECalComponentAttendee *)(l->data);
+		ExchangeMAPIRecipient *recipient = g_new0 (ExchangeMAPIRecipient, 1);
+		uint32_t val = 0;
+		const char *str = NULL;
+		if (attendee->value && !g_ascii_strncasecmp (attendee->value, "mailto:";, 7)) 
+			recipient->email_id = (attendee->value) + 7;
+		else 
+			recipient->email_id = (attendee->value);
+		recipient->in.req_lpProps = g_new0 (struct SPropValue, 5);
+		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;
+		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);
+		val = get_type_from_role (attendee->role);
+		set_SPropValue_proptag (&(recipient->in.req_lpProps[3]), PR_RECIPIENT_TYPE, (const void *) &val);
+/*		if (attendee->cn && *(attendee->cn))
+			str = attendee->cn;
+		else 
+			str = "";
+		set_SPropValue_proptag (&(recipient->in.req_lpProps[4]), PR_RECIPIENT_DISPLAY_NAME, (const void *)(str));
+*/
+		*recip_list = g_slist_append (*recip_list, recipient);
+	}
+
+	e_cal_component_free_attendee_list (al);
+}
+
 static void 
-ical_attendees_from_props (icalcomponent *ical_comp, GSList *recipients)
+ical_attendees_from_props (icalcomponent *ical_comp, GSList *recipients, gboolean rsvp)
 {
 	GSList *l;
 	for (l=recipients; l; l=l->next) {
@@ -208,31 +273,50 @@
 		icalproperty *prop = NULL;
 		icalparameter *param;
 		gchar *val;
+		const uint32_t *ui32;
+		const char *str;
+		uint32_t *flags; 
 
 		if (recip->email_id)
 			val = g_strdup_printf ("MAILTO:%s", recip->email_id);
 		else 
 			continue;
 
-		if (recip->flags & MEET_ORGANIZER) {
+		flags = (const uint32_t *) get_SPropValue(recip->out.all_lpProps, PR_RECIPIENTS_FLAGS);
+
+		if (flags && (*flags & RECIP_ORGANIZER)) {
 			prop = icalproperty_new_organizer (val);
+
 			/* CN */
-			param = icalparameter_new_cn (recip->name);
-			icalproperty_add_parameter (prop, param);
-		} else /* if (recip->flags & MEET_ATTENDEE) */ {
+			str = (const char *) get_SPropValue(recip->out.all_lpProps, PR_RECIPIENT_DISPLAY_NAME);
+			if (str) {
+				param = icalparameter_new_cn (str);
+				icalproperty_add_parameter (prop, param);
+			}
+		} else {
 			prop = icalproperty_new_attendee (val);
+
 			/* CN */
-			param = icalparameter_new_cn (recip->name);
-			icalproperty_add_parameter (prop, param);
+			str = (const char *) get_SPropValue(recip->out.all_lpProps, PR_RECIPIENT_DISPLAY_NAME);
+			if (str) {
+				param = icalparameter_new_cn (str);
+				icalproperty_add_parameter (prop, param);
+			}
 			/* RSVP */
-			param = icalparameter_new_rsvp (ICAL_RSVP_TRUE);
+			param = icalparameter_new_rsvp (rsvp ? ICAL_RSVP_TRUE : ICAL_RSVP_FALSE);
 			icalproperty_add_parameter (prop, param);
 			/* PARTSTAT */
-			param = icalparameter_new_partstat (get_partstat_from_trackstatus (recip->trackstatus));
-			icalproperty_add_parameter (prop, param);
+			ui32 = (const uint32_t *) get_SPropValue(recip->out.all_lpProps, PR_RECIPIENT_TRACKSTATUS);
+			if (ui32) {
+				param = icalparameter_new_partstat (get_partstat_from_trackstatus (*ui32));
+				icalproperty_add_parameter (prop, param);
+			}
 			/* ROLE */
-			param = icalparameter_new_role (get_role_from_type (recip->type));
-			icalproperty_add_parameter (prop, param);
+			ui32 = (const uint32_t *) get_SPropValue(recip->out.all_lpProps, PR_RECIPIENT_TYPE);
+			if (ui32) {
+				param = icalparameter_new_role (get_role_from_type (*ui32));
+				icalproperty_add_parameter (prop, param);
+			}
 #if 0
 			/* CALENDAR USER TYPE */
 			param = icalparameter_new_cutype ();
@@ -247,6 +331,132 @@
 	}
 }
 
+static const uint8_t GID_START_SEQ[] = {
+	0x04, 0x00, 0x00, 0x00, 0x82, 0x00, 0xe0, 0x00,
+	0x74, 0xc5, 0xb7, 0x10, 0x1a, 0x82, 0xe0, 0x08
+};
+
+void
+e_cal_backend_mapi_util_generate_globalobjectid (gboolean is_clean, const char *uid, struct SBinary *sb)
+{
+	GByteArray *ba;
+	guint32 flag32;
+	guchar *buf = NULL;
+	gsize len;
+	d(guint32 i);
+
+	ba = g_byte_array_new ();
+
+	ba = g_byte_array_append (ba, GID_START_SEQ, (sizeof (GID_START_SEQ) / sizeof (GID_START_SEQ[0])));
+
+	/* FIXME for exceptions */
+	if (is_clean || TRUE) {
+		flag32 = 0;
+		ba = g_byte_array_append (ba, &flag32, sizeof (guint32));
+	}
+
+	/* creation time - may be all 0's  */
+	flag32 = 0;
+	ba = g_byte_array_append (ba, &flag32, sizeof (guint32));
+	flag32 = 0;
+	ba = g_byte_array_append (ba, &flag32, sizeof (guint32));
+
+	/* RESERVED - should be all 0's  */
+	flag32 = 0;
+	ba = g_byte_array_append (ba, &flag32, sizeof (guint32));
+	flag32 = 0;
+	ba = g_byte_array_append (ba, &flag32, sizeof (guint32));
+
+	/* FIXME: cleanup the UID first */
+
+	/* We put Evolution's UID in base64 here */
+	buf = g_base64_decode (uid, &len);
+	if (len % 2 != 0)
+		--len;
+	flag32 = len;
+
+	/* Size in bytes of the following data */
+	ba = g_byte_array_append (ba, &flag32, sizeof (guint32));
+	/* Data */
+	ba = g_byte_array_append (ba, buf, flag32);
+	g_free (buf);
+
+	sb->lpb = ba->data;
+	sb->cb = ba->len;
+
+	d(g_message ("New GlobalObjectId.. Length: %d bytes.. Hex-data follows:", ba->len));
+	d(for (i = 0; i < ba->len; i++) 
+		g_print("0x%.2X ", ba->data[i]));
+
+	g_byte_array_free (ba, FALSE);
+}
+
+static gchar *
+id_to_string (GByteArray *ba)
+{
+	guint8 *ptr;
+	guint len;
+	gchar *buf = NULL;
+	guint32 flag32, i, j;
+
+	g_return_val_if_fail (ba != NULL, NULL);
+	/* MSDN docs: the globalID must have an even number of bytes */
+	if ((ba->len)%2 != 0)
+		return NULL;
+
+	ptr = ba->data;
+	len = ba->len;
+
+	/* starting seq - len = 16 bytes */
+	for (i = 0, j = 0;(i < len) && (j < sizeof (GID_START_SEQ)); ++i, ++ptr, ++j)
+		if (*ptr != GID_START_SEQ[j])
+			return NULL;
+
+	/* FIXME: for exceptions - len = 4 bytes */
+	flag32 = *((guint32 *)ptr);
+	i += sizeof (guint32);
+	if (!(i < len) || flag32 != 0)
+		return NULL;
+	ptr += sizeof (guint32);
+
+	/* Creation time - len = 8 bytes - skip it */
+	flag32 = *((guint32 *)ptr);
+	i += sizeof (guint32);
+	if (!(i < len))
+		return NULL;
+	ptr += sizeof (guint32);
+
+	flag32 = *((guint32 *)ptr);
+	i += sizeof (guint32);
+	if (!(i < len))
+		return NULL;
+	ptr += sizeof (guint32);
+
+	/* Reserved bytes - len = 8 bytes */
+	flag32 = *((guint32 *)ptr);
+	i += sizeof (guint32);
+	if (!(i < len) || flag32 != 0)
+		return NULL;
+	ptr += sizeof (guint32);
+
+	flag32 = *((guint32 *)ptr);
+	i += sizeof (guint32);
+	if (!(i < len) || flag32 != 0)
+		return NULL;
+	ptr += sizeof (guint32);
+
+	/* This is the real data */
+	flag32 = *((guint32 *)ptr);
+	i += sizeof (guint32);
+	if (!(i < len) || flag32 != (len - i))
+		return NULL;
+	ptr += sizeof (guint32);
+
+	buf = g_base64_encode (ptr, flag32);
+
+	return buf;
+}
+
 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)
@@ -318,6 +528,26 @@
 		const gchar *dtstart_tz = NULL, *dtend_tz = NULL;
 		ExchangeMAPIStream *stream;
 
+		/* CleanGlobalObjectId */
+		stream = exchange_mapi_util_find_stream (streams, PROP_TAG(PT_BINARY, 0x0023));
+		if (stream) {
+			gchar *value = id_to_string (stream->value);
+			prop = icalproperty_new_x (value);
+			icalproperty_set_x_name (prop, "X-EVOLUTION-MAPI-CLEAN-GLOBALID");
+			icalcomponent_add_property (ical_comp, prop);
+			g_free (value);
+		}
+
+		/* GlobalObjectId */
+		stream = exchange_mapi_util_find_stream (streams, PROP_TAG(PT_BINARY, 0x0003));
+		if (stream) {
+			gchar *value = id_to_string (stream->value);
+			prop = icalproperty_new_x (value);
+			icalproperty_set_x_name (prop, "X-EVOLUTION-MAPI-GLOBALID");
+			icalcomponent_add_property (ical_comp, prop);
+			g_free (value);
+		}
+
 		location = (const char *)exchange_mapi_util_find_array_propval(properties, PROP_TAG(PT_STRING8, 0x8208));
 		if (location && *location)
 			icalcomponent_set_location (ical_comp, location);
@@ -377,8 +607,8 @@
 */		} 
 
 		if (recipients) {
-			g_print ("\n\nFound a group event...\n");
-			ical_attendees_from_props (ical_comp, recipients);
+			b = (const bool *)find_mapi_SPropValue_data(properties, PR_RESPONSE_REQUESTED);
+			ical_attendees_from_props (ical_comp, recipients, (b && *b));
 			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);
@@ -411,18 +641,17 @@
 			}
 		}
 
-		/* FIXME: the ALARM definitely needs more work */
 		b = (const bool *)find_mapi_SPropValue_data(properties, PROP_TAG(PT_BOOLEAN, 0x8503));
 		if (b && *b) {
-			struct timeval start, before;
+			struct timeval start, displaytime;
 
 			if ((get_mapi_SPropValue_array_date_timeval (&start, properties, PROP_TAG(PT_SYSTIME, 0x8502)) == MAPI_E_SUCCESS) 
-			 && (get_mapi_SPropValue_array_date_timeval (&before, properties, PROP_TAG(PT_SYSTIME, 0x8560)) == MAPI_E_SUCCESS)) {
+			 && (get_mapi_SPropValue_array_date_timeval (&displaytime, properties, PROP_TAG(PT_SYSTIME, 0x8560)) == MAPI_E_SUCCESS)) {
 				ECalComponentAlarm *e_alarm = e_cal_component_alarm_new ();
 				ECalComponentAlarmTrigger trigger;
 
 				trigger.type = E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START;
-				trigger.u.rel_duration = icaltime_subtract (icaltime_from_timet_with_zone (before.tv_sec, 0, 0), 
+				trigger.u.rel_duration = icaltime_subtract (icaltime_from_timet_with_zone (displaytime.tv_sec, 0, 0), 
 									    icaltime_from_timet_with_zone (start.tv_sec, 0, 0));
 
 				e_cal_component_alarm_set_action (e_alarm, E_CAL_COMPONENT_ALARM_DISPLAY);
@@ -484,7 +713,6 @@
 			g_warning ("Encountered a recurring task.");
 		}
 
-		/* FIXME: the ALARM definitely needs more work */
 		b = (const bool *)find_mapi_SPropValue_data(properties, PROP_TAG(PT_BOOLEAN, 0x8503));
 		if (b && *b) {
 			struct timeval abs;
@@ -574,7 +802,7 @@
 	I_COMMON_REMTIME , 
 	I_COMMON_REMSET , 
 	I_COMMON_ISPRIVATE , 
-	I_COMMON_CTXMENUFLAGS , 
+	I_COMMON_SIDEEFFECTS , 
 	I_COMMON_START , 
 	I_COMMON_END , 
 	I_COMMON_REMNEXTTIME 
@@ -631,71 +859,97 @@
  */
 
 
-#define APPT_NAMED_PROPS_N  19
+#define APPT_NAMED_PROPS_N  31
 #define DEFAULT_APPT_REMINDER_MINS 15
 
 typedef enum 
 {
-	I_APPT_BUSYSTATUS = COMMON_NAMED_PROPS_N , 
+	I_APPT_SEQ = COMMON_NAMED_PROPS_N , 
+	I_APPT_SEQTIME , 
+	I_APPT_BUSYSTATUS , 
 	I_APPT_LOCATION , 
 	I_APPT_START , 
 	I_APPT_END , 
 	I_APPT_DURATION , 
 	I_APPT_ALLDAY , 
-	I_APPT_RECURBLOB , 
+/**/	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_RECURRING , 
+	I_APPT_INTENDEDBUSY , 
+/**/	I_APPT_RECURBASE , 
+	I_APPT_INVITED , 
+/**/	I_APPT_RECURTYPE , 
+/**/	I_APPT_RECURPATTERN , 
+	I_APPT_CLIPSTART , 
+	I_APPT_CLIPEND , 
+	I_APPT_AUTOLOCATION , 
 	I_APPT_ISONLINEMEET , 
 	I_APPT_COUNTERPROPOSAL , 
 	I_APPT_STARTTZBLOB , 
-	I_APPT_ENDTZBLOB 
+	I_APPT_ENDTZBLOB ,
+
+	I_MEET_WHERE , 
+	I_MEET_GUID , 
+	I_MEET_ISRECURRING , 
+	I_MEET_ISEXCEPTION , 
+	I_MEET_CLEANGUID , 
+	I_MEET_APPTMSGCLASS , 
+	I_MEET_TYPE
+
 //	I_SENDASICAL , 
 //	I_APPT_LABEL , 
 //	I_APPT_DISPTZ 
+//	I_APPT_ALLATTENDEES , 
+//	I_APPT_TOATTENDEES , 
+//	I_APPT_CCATTENDEES , 
 } ApptNamedPropsIndex;
 
 static void 
 appt_build_name_id (struct mapi_nameid *nameid)
 {
+	mapi_nameid_lid_add(nameid, 0x8201, PSETID_Appointment); 	// PT_LONG - ApptSequence
+	mapi_nameid_lid_add(nameid, 0x8202, PSETID_Appointment); 	// PT_SYSTIME - ApptSequenceTime
 	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
+	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 - IsRecurring/Recurring
+	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, 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, 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, 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)
 }
 
-
 #define TASK_NAMED_PROPS_N 13
 #define DEFAULT_TASK_REMINDER_MINS 1080
 
@@ -759,44 +1013,58 @@
 //	mapi_nameid_lid_add(nameid, 0x8B00, PSETID_Note); 	// PT_LONG - Color
 }
 
-
 #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. 
  */
+#define REGULAR_PROPS_N    21
+
 int
 mapi_cal_build_props (struct SPropValue **value, struct SPropTagArray *proptag_array, gpointer data)
 {
-	ECalComponent *comp = E_CAL_COMPONENT (data);
+	struct cbdata *cbdata = (struct cbdata *) data;
+	ECalBackendMAPI *cbmapi = cbdata->cbmapi;
+	ECalComponent *comp = cbdata->comp;
 	icalcomponent *ical_comp = e_cal_component_get_icalcomponent (comp);
 	icalcomponent_kind  kind = icalcomponent_isa (ical_comp);
-	struct SPropValue *props;
+	gboolean has_attendees = e_cal_component_has_attendees (comp);
+	struct SPropValue *props = NULL;
 	int i=0;
-	int32_t flag32;
+	uint32_t flag32;
 	bool b;
 	icalproperty *prop;
 	struct icaltimetype dtstart, dtend, utc_dtstart, utc_dtend;
 	const icaltimezone *utc_zone;
 	const char *dtstart_tzid, *dtend_tzid, *text = NULL;
+	const char *uid = NULL;
 	struct timeval t;
 
 	switch (kind) {
 		case ICAL_VEVENT_COMPONENT:
-			props = g_new (struct SPropValue, REGULAR_PROPS_N + APPT_NAMED_PROPS_N);
-			set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (const void *) "IPM.Appointment");
+			props = g_new0 (struct SPropValue, REGULAR_PROPS_N + COMMON_NAMED_PROPS_N + APPT_NAMED_PROPS_N);
+			g_print ("\nAllocating space for %d props\n", REGULAR_PROPS_N + COMMON_NAMED_PROPS_N + APPT_NAMED_PROPS_N);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_APPTMSGCLASS], (const void *) "IPM.Appointment");
+			if (has_attendees) {
+				if (cbdata->meeting_type & MEETING_OBJECT)
+					set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (const void *) "IPM.Appointment");
+				else if (cbdata->meeting_type & MEETING_REQUEST)
+					set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (const void *) "IPM.Schedule.Meeting.Request");
+				else 
+					set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (const void *) "IPM.Appointment");
+			} else
+				set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (const void *) "IPM.Appointment");
 			break;
 		case ICAL_VTODO_COMPONENT:
-			props = g_new (struct SPropValue, REGULAR_PROPS_N + TASK_NAMED_PROPS_N);
+			props = g_new0 (struct SPropValue, REGULAR_PROPS_N + COMMON_NAMED_PROPS_N + TASK_NAMED_PROPS_N);
+			g_print ("\nAllocating space for %d props\n", REGULAR_PROPS_N + COMMON_NAMED_PROPS_N + TASK_NAMED_PROPS_N);
 			set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (const void *) "IPM.Task");
 			break;
 		case ICAL_VJOURNAL_COMPONENT:
-			props = g_new (struct SPropValue, REGULAR_PROPS_N + NOTE_NAMED_PROPS_N);
+			props = g_new0 (struct SPropValue, REGULAR_PROPS_N + COMMON_NAMED_PROPS_N + NOTE_NAMED_PROPS_N);
+			g_print ("\nAllocating space for %d props\n", REGULAR_PROPS_N + COMMON_NAMED_PROPS_N + NOTE_NAMED_PROPS_N);
 			set_SPropValue_proptag(&props[i++], PR_MESSAGE_CLASS, (const void *) "IPM.StickyNote");
 			break;
 		default:
@@ -858,23 +1126,50 @@
 	} 
 	set_SPropValue_proptag(&props[i++], PR_PRIORITY, (const void *) &flag32); 		/* prop count: 7 */
 
-/*
-PR_SENT_REPRESENTING_NAME
-PR_SENT_REPRESENTING_ADDRTYPE
-PR_SENT_REPRESENTING_EMAIL_ADDRESS
-PR_SENDER_NAME
-PR_SENDER_ADDRTYPE
-PR_SENDER_EMAIL_ADDRESS
-*/
 
-	flag32 = 0x1;
-	set_SPropValue_proptag(&props[i++], PR_MESSAGE_FLAGS, (const void *) &flag32); 		/* prop count: 8 */
+	set_SPropValue_proptag(&props[i++], PR_SENT_REPRESENTING_NAME, 
+		(const void *) e_cal_backend_mapi_get_owner_name (cbmapi));
+	text = "SMTP";
+	set_SPropValue_proptag(&props[i++], PR_SENT_REPRESENTING_ADDRTYPE, 
+		(const void *) text);
+	set_SPropValue_proptag(&props[i++], PR_SENT_REPRESENTING_EMAIL_ADDRESS, 
+		(const void *) e_cal_backend_mapi_get_owner_email (cbmapi));
+	set_SPropValue_proptag(&props[i++], PR_SENDER_NAME, 
+		(const void *) e_cal_backend_mapi_get_user_name (cbmapi));
+	text = "SMTP";
+	set_SPropValue_proptag(&props[i++], PR_SENDER_ADDRTYPE, 
+		(const void *) text);
+	set_SPropValue_proptag(&props[i++], PR_SENDER_EMAIL_ADDRESS, 
+		(const void *) e_cal_backend_mapi_get_user_email (cbmapi)); 			/* prop count: 13 */
+
+	flag32 = cbdata->msgflags;
+	set_SPropValue_proptag(&props[i++], PR_MESSAGE_FLAGS, (const void *) &flag32); 		/* prop count: 14 */
 
 	flag32 = 0x0;
 	b = e_cal_component_has_alarms (comp);
 	if (b) {
-		/* FIXME: write code here */
-	} else {
+		/* We know there would be only a single alarm of type:DISPLAY [static properties of the backend] */
+		GList *alarm_uids = e_cal_component_get_alarm_uids (comp);
+		ECalComponentAlarm *alarm = e_cal_component_get_alarm (comp, (const char *)(alarm_uids->data));
+		ECalComponentAlarmAction action;
+		e_cal_component_alarm_get_action (alarm, &action);
+		if (action == E_CAL_COMPONENT_ALARM_DISPLAY) {
+			ECalComponentAlarmTrigger trigger;
+			e_cal_component_alarm_get_trigger (alarm, &trigger);
+			switch (trigger.type) {
+			case E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START :
+				flag32 = (icaldurationtype_as_int (trigger.u.rel_duration)) / SECS_IN_MINUTE;
+			/* we cannot set an alarm to popup after the start of an appointment on Exchange */
+				flag32 = (flag32 < 0) ? -(flag32) : 0;
+				break;
+			default :
+				break;
+			}
+		}
+		e_cal_component_alarm_free (alarm);
+		cal_obj_uid_list_free (alarm_uids);
+	} 
+	if (!flag32)
 		switch (kind) {
 			case ICAL_VEVENT_COMPONENT:
 				flag32 = DEFAULT_APPT_REMINDER_MINS;
@@ -885,20 +1180,19 @@
 			default:
 				break;
 		}
-		t.tv_sec = icaltime_as_timet (utc_dtstart) - (flag32 * SECS_IN_MINUTE);
-		t.tv_usec = 0;
-	}
+	set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_REMSET], (const void *) &b);
 	set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_REMMINS], (const void *) &flag32);
+	t.tv_sec = icaltime_as_timet (utc_dtstart);
+	t.tv_usec = 0;
 	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) */
-
+	t.tv_sec = icaltime_as_timet (utc_dtstart) - (flag32 * SECS_IN_MINUTE);
+	t.tv_usec = 0;
 	/* ReminderNextTime: FIXME for recurrence */
 	set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[I_COMMON_REMNEXTTIME], &t);
-
+												/* prop count: 14 (no regular props added) */
 	/* Sensitivity, Private */
 	flag32 = olNormal; 	/* default */
-	b = 0; 				/* default */
+	b = 0; 			/* default */
 	prop = icalcomponent_get_first_property (ical_comp, ICAL_CLASS_PROPERTY);
 	if (prop) 
 		switch (icalproperty_get_class (prop)) {
@@ -914,26 +1208,31 @@
 			default: 
 				break;
 		}
-	set_SPropValue_proptag(&props[i++], PR_SENSITIVITY, (const void *) &flag32); 		/* prop count: 9 */
+	set_SPropValue_proptag(&props[i++], PR_SENSITIVITY, (const void *) &flag32); 		/* prop count: 15 */
 	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[I_COMMON_START], &t);
-	set_SPropValue_proptag_date_timeval(&props[i++], PR_START_DATE, &t); 			/* prop count: 10 */
+	set_SPropValue_proptag_date_timeval(&props[i++], PR_START_DATE, &t); 			/* prop count: 16 */
 
 	t.tv_sec = icaltime_as_timet (utc_dtend);
 	t.tv_usec = 0;
 	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 */
+	set_SPropValue_proptag_date_timeval(&props[i++], PR_END_DATE, &t); 			/* prop count: 17 */
+
+	b = 1;
+	set_SPropValue_proptag(&props[i++], PR_RESPONSE_REQUESTED, (const void *) &b); 		/* prop count: 18 */
+
+	/* PR_OWNER_APPT_ID needs to be set in certain cases only */				/* prop count: 19 */
+	/* PR_ICON_INDEX needs to be set appropriately */					/* prop count: 20 */
+
+	b = 0;
+	set_SPropValue_proptag(&props[i++], PR_RTF_IN_SYNC, (const void *) &b); 		/* prop count: 21 */
 
 	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);
+		struct SBinary start_tz, end_tz, globalid; 
 
 		/* Busy Status */
 		flag32 = olBusy; 	/* default */
@@ -952,19 +1251,30 @@
 				default:
 					break;
 			}
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_BUSYSTATUS], (const void *) &flag32);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_INTENDEDBUSY], (const void *) &flag32);
+		if (cbdata->meeting_type == MEETING_REQUEST) {
+			flag32 = olTentative;
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_BUSYSTATUS], (const void *) &flag32);
+		} else 
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_BUSYSTATUS], (const void *) &flag32);
 
 		/* Location */
 		text = icalcomponent_get_location (ical_comp);
 		if (!(text && *text)) 
 			text = "";
 		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_LOCATION], (const void *) text);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_WHERE], (const void *) text);
 		text = NULL;
+		/* Auto-Location is always FALSE - Evolution doesn't work that way */
+		b = 0; 
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_AUTOLOCATION], (const void *) &b);
 
 		/* Start */
 		t.tv_sec = icaltime_as_timet (utc_dtstart);
 		t.tv_usec = 0;
 		set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[I_APPT_START], &t);
+		/* FIXME: for recurrence */
+		set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[I_APPT_CLIPSTART], &t);
 
 		/* Start TZ */
 		mapi_tzid = e_cal_backend_mapi_tz_util_get_mapi_equivalent ((dtstart_tzid && *dtstart_tzid) ? dtstart_tzid : "UTC");
@@ -977,6 +1287,8 @@
 		t.tv_sec = icaltime_as_timet (utc_dtend);
 		t.tv_usec = 0;
 		set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[I_APPT_END], &t);
+		/* FIXME: for recurrence */
+		set_SPropValue_proptag_date_timeval(&props[i++], proptag_array->aulPropTag[I_APPT_CLIPEND], &t);
 
 		/* End TZ */
 		mapi_tzid = e_cal_backend_mapi_tz_util_get_mapi_equivalent ((dtend_tzid && *dtend_tzid) ? dtend_tzid : "UTC");
@@ -994,19 +1306,114 @@
 		b = (icaltime_is_date (dtstart) && icaltime_is_date (dtend));
 		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[I_APPT_MEETINGSTATUS], (const void *) &flag32);
-
-		/* Recurring */
-		b = e_cal_component_has_recurrences (comp);
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_ISRECURRING], (const void *) &b);
+		/* FIXME: for RecurrenceType */
+		flag32 = rectypeNone ;
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_RECURTYPE], (const void *) &flag32);
+
+		switch (cbdata->meeting_type) {
+		case MEETING_OBJECT :
+			flag32 = e_cal_component_has_recurrences (comp) ? RecurMeet : SingleMeet; 
+			set_SPropValue_proptag(&props[i++], PR_ICON_INDEX, (const void *) &flag32);
+
+			flag32 = 0x0171;
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_SIDEEFFECTS], (const void *) &flag32);
+
+			flag32 = olMeeting;
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_MEETINGSTATUS], (const void *) &flag32);
+
+			flag32 = mtgRequest; 
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_TYPE], (const void *) &flag32);
+
+			flag32 = olResponseOrganized;
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_RESPONSESTATUS], (const void *) &flag32);
+
+			b = 0;
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_INVITED], (const void *) &b);
+
+			flag32 = cbdata->new_appt_id;
+			set_SPropValue_proptag(&props[i++], PR_OWNER_APPT_ID, (const void *) &flag32);
+
+			e_cal_component_get_uid (comp, &uid);
+			e_cal_backend_mapi_util_generate_globalobjectid (TRUE, uid, &globalid);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_CLEANGUID], (const void *) &globalid);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_GUID], (const void *) &globalid);
+
+			break;
+		case MEETING_REQUEST :
+			flag32 = 0xFFFFFFFF;  /* no idea why this has to be -1, but that's what the docs say */
+			set_SPropValue_proptag(&props[i++], PR_ICON_INDEX, (const void *) &flag32);
+
+			flag32 = 0x1C61;
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_SIDEEFFECTS], (const void *) &flag32);
+
+			flag32 = olMeetingReceived;
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_MEETINGSTATUS], (const void *) &flag32);
+
+			flag32 = mtgRequest; 
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_TYPE], (const void *) &flag32);
+
+			flag32 = olResponseNotResponded;
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_RESPONSESTATUS], (const void *) &flag32);
+
+			b = 1;
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_INVITED], (const void *) &b);
+
+			flag32 = cbdata->dup.owner_appt_id;
+			set_SPropValue_proptag(&props[i++], PR_OWNER_APPT_ID, (const void *) &flag32);
+
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_CLEANGUID], (const void *) cbdata->dup.cleanglobalid);
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_GUID], (const void *) cbdata->dup.globalid);
+
+			break;
+		case MEETING_RESPONSE : 
+			flag32 = RespAccept; 
+			set_SPropValue_proptag(&props[i++], PR_ICON_INDEX, (const void *) &flag32);
+
+			flag32 = 0x0171;
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_SIDEEFFECTS], (const void *) &flag32);
+/*
+			flag32 = olMeeting;
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_MEETINGSTATUS], (const void *) &flag32);
+*/
+			flag32 = mtgRequest; 
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_TYPE], (const void *) &flag32);
+
+			flag32 = olResponseAccepted;
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_RESPONSESTATUS], (const void *) &flag32);
+
+			break;
+		case NOT_A_MEETING :
+		default :
+			flag32 = e_cal_component_has_recurrences (comp) ? RecurAppt : SingleAppt; 
+			set_SPropValue_proptag(&props[i++], PR_ICON_INDEX, (const void *) &flag32);
+
+			flag32 = 0x0171;
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_SIDEEFFECTS], (const void *) &flag32);
+
+			flag32 = olNonMeeting;
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_MEETINGSTATUS], (const void *) &flag32);
+
+			flag32 = olResponseNone;
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_RESPONSESTATUS], (const void *) &flag32);
+
+			b = 0;
+			set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_INVITED], (const void *) &b);
+
+			break;
+		}
+
+		/* FIXME: Recurring */
+		b = e_cal_component_has_recurrences (comp) && FALSE; b = 0;
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_RECURRING], (const void *) &b);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_ISRECURRING], (const void *) &b);
+		b = e_cal_component_has_exceptions (comp) && FALSE; b = 0;
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_MEET_ISEXCEPTION], (const void *) &b);
 
 		/* Online Meeting : we probably would never support this */
 		b = 0;
 		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_ISONLINEMEET], (const void *) &b);
 
-		/* Counter Proposal for appointments : not supported as of now */
+		/* Counter Proposal for appointments : not supported */
 		b = 0;
 		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_APPT_COUNTERPROPOSAL], (const void *) &b);
 
@@ -1015,7 +1422,7 @@
 
 		/* Context menu flags */ /* FIXME: for assigned tasks */
 		flag32 = 272; 
-		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_CTXMENUFLAGS], (const void *) &flag32);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_SIDEEFFECTS], (const void *) &flag32);
 
 		/* Status, Percent complete, IsComplete */
 		flag32 = olTaskNotStarted; 	/* default */
@@ -1074,12 +1481,14 @@
 	} 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);
+		set_SPropValue_proptag(&props[i++], proptag_array->aulPropTag[I_COMMON_SIDEEFFECTS], (const void *) &flag32);
 
 	}
 
 	*value = props;
 
+	g_print ("\nEnded up setting %d props\n", i);
+
 	return i;
 }
 

Modified: branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-utils.h
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-utils.h	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi-utils.h	Sun Jun 29 06:04:50 2008
@@ -1,21 +1,24 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ *  Authors: 
+ *    Suman Manjunath <msuman novell com>
  *
- *  Suman Manjunath <msuman novell com>
- *  Copyright (C) 2007 Novell, Inc.
+ *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  *
  *  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.
+ *  it under the terms of version 2 of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation.
  *
  *  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.
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public 
+ *  License along with this program; if not, write to: 
+ *  Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
  *
- *  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.
  */
 
 
@@ -28,6 +31,8 @@
 G_BEGIN_DECLS
 
 void
+e_cal_backend_mapi_util_fetch_recipients (ECalBackendMAPI *cbmapi, ECalComponent *comp, GSList **recip_list);
+void
 e_cal_backend_mapi_util_fetch_attachments (ECalBackendMAPI *cbmapi, ECalComponent *comp, GSList **attach_list);
 //void
 //set_attachments_to_cal_component (ECalBackendMAPI *cbmapi, ECalComponent *comp, GSList *attach_list);
@@ -42,6 +47,9 @@
 int
 mapi_cal_build_props (struct SPropValue **value, struct SPropTagArray *proptag_array, gpointer data);
 
+void
+e_cal_backend_mapi_util_generate_globalobjectid (gboolean is_clean, const char *uid, struct SBinary *sb);
+
 G_END_DECLS
 
 #endif

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	Sun Jun 29 06:04:50 2008
@@ -1,24 +1,28 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ *  Authors: 
+ *    Suman Manjunath <msuman novell com>
  *
- *  Suman Manjunath <msuman novell com>
- *  Copyright (C) 2008 Novell, Inc.
+ *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  *
  *  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.
+ *  it under the terms of version 2 of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation.
  *
  *  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.
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public 
+ *  License along with this program; if not, write to: 
+ *  Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
  *
- *  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.
  */
 
 
+
 #include <libecal/e-cal-time-util.h>
 #include <gio/gio.h>
 
@@ -284,7 +288,7 @@
 				CAL_STATIC_CAPABILITY_NO_THISANDFUTURE ","
 				CAL_STATIC_CAPABILITY_NO_THISANDPRIOR ","
 //				CAL_STATIC_CAPABILITY_NO_TRANSPARENCY ","
-				CAL_STATIC_CAPABILITY_ORGANIZER_MUST_ATTEND ","
+//				CAL_STATIC_CAPABILITY_ORGANIZER_MUST_ATTEND ","
 //				CAL_STATIC_CAPABILITY_ORGANIZER_NOT_EMAIL_ADDRESS ","
 //				CAL_STATIC_CAPABILITY_SAVE_SCHEDULES ","
 				CAL_STATIC_CAPABILITY_NO_CONV_TO_ASSIGN_TASK ","
@@ -292,7 +296,7 @@
 //				CAL_STATIC_CAPABILITY_NO_GEN_OPTIONS ","
 //				CAL_STATIC_CAPABILITY_REQ_SEND_OPTIONS ","
 //				CAL_STATIC_CAPABILITY_RECURRENCES_NO_MASTER ","
-				CAL_STATIC_CAPABILITY_ORGANIZER_MUST_ACCEPT ","
+//				CAL_STATIC_CAPABILITY_ORGANIZER_MUST_ACCEPT ","
 //				CAL_STATIC_CAPABILITY_DELEGATE_SUPPORTED ","
 //				CAL_STATIC_CAPABILITY_NO_ORGANIZER ","
 //				CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY ","
@@ -359,8 +363,9 @@
 	PR_PRIORITY, 
 	PR_SENSITIVITY, 
 	PR_START_DATE, 
-	PR_END_DATE
-/*
+	PR_END_DATE, 
+	PR_RESPONSE_REQUESTED, 
+
 	PR_SENT_REPRESENTING_NAME, 
 	PR_SENT_REPRESENTING_NAME_UNICODE, 
 	PR_SENT_REPRESENTING_ADDRTYPE, 
@@ -381,7 +386,6 @@
 	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);
 
@@ -403,15 +407,6 @@
 
 //	exchange_mapi_debug_property_dump (array);
 
-	/* 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;
-	}
-
 	recurring = NULL;
 	/* FIXME: Provide backend support for recurrence for appointments/meetings */
 	recurring = (const bool *)find_mapi_SPropValue_data(array, PROP_TAG(PT_BOOLEAN, 0x8223));
@@ -572,7 +567,11 @@
 	strftime (t_str, 26, "%Y-%m-%dT%H:%M:%SZ", &tm);
 
 //	e_file_cache_freeze_changes (E_FILE_CACHE (priv->cache));
-	if (!exchange_mapi_connection_fetch_items (priv->fid, GetPropsList, n_GetPropsList, mapi_cal_build_name_id, use_restriction ? &res : NULL, mapi_cal_get_changes_cb, cbmapi, MAPI_OPTIONS_FETCH_ALL)) {
+	if (!exchange_mapi_connection_fetch_items (priv->fid, use_restriction ? &res : NULL, 
+						GetPropsList, n_GetPropsList, 
+						mapi_cal_build_name_id, cbmapi, 
+						mapi_cal_get_changes_cb, cbmapi, 
+						MAPI_OPTIONS_FETCH_ALL)) {
 		/* FIXME: better string please... */
 		e_cal_backend_notify_error (E_CAL_BACKEND (cbmapi), _("Error fetching changes from the server. Removing the cache might help."));
 //		e_file_cache_thaw_changes (E_FILE_CACHE (priv->cache));
@@ -592,7 +591,11 @@
 	 * The items in the list are pointers to internal data, 
 	 * 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, IDList, n_IDList, NULL, NULL, handle_deleted_items_cb, cbmapi, 0)) {
+	if (!exchange_mapi_connection_fetch_items (priv->fid, NULL, 
+						IDList, n_IDList, 
+						NULL, NULL, 
+						handle_deleted_items_cb, cbmapi, 
+						0)) {
 		/* FIXME: better string please... */
 		e_cal_backend_notify_error (E_CAL_BACKEND (cbmapi), _("Error fetching changes from the server. Removing the cache might help."));
 		priv->cache_keys = NULL;
@@ -868,15 +871,6 @@
 
 //	exchange_mapi_debug_property_dump (properties);
 
-	/* 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;
-	}
-
 	switch (e_cal_backend_get_kind (E_CAL_BACKEND (cbmapi))) {
 		case ICAL_VEVENT_COMPONENT:
 			/* FIXME: Provide backend support for recurrence */
@@ -955,7 +949,11 @@
 	strftime (t_str, 26, "%Y-%m-%dT%H:%M:%SZ", &tm);
 
 //	e_file_cache_freeze_changes (E_FILE_CACHE (priv->cache));
-	if (!exchange_mapi_connection_fetch_items (priv->fid, GetPropsList, n_GetPropsList, mapi_cal_build_name_id, NULL, mapi_cal_cache_create_cb, cbmapi, MAPI_OPTIONS_FETCH_ALL)) {
+	if (!exchange_mapi_connection_fetch_items (priv->fid, NULL, 
+						GetPropsList, n_GetPropsList, 
+						mapi_cal_build_name_id, cbmapi, 
+						mapi_cal_cache_create_cb, cbmapi, 
+						MAPI_OPTIONS_FETCH_ALL)) {
 		e_cal_backend_notify_error (E_CAL_BACKEND (cbmapi), _("Could not create cache file"));
 		e_file_cache_thaw_changes (E_FILE_CACHE (priv->cache));
 		g_free (progress_string);
@@ -1153,7 +1151,12 @@
 
 	priv->username = g_strdup (username);
 	priv->password = g_strdup (password);
-	priv->user_email = g_strdup (e_source_get_property (esource, "profile"));
+
+	priv->user_name = g_strdup (e_source_get_property (esource, "acl-user-name"));
+	priv->user_email = g_strdup (e_source_get_property (esource, "acl-user-email"));
+	priv->owner_name = g_strdup (e_source_get_property (esource, "acl-owner-name"));
+	priv->owner_email = g_strdup (e_source_get_property (esource, "acl-owner-email"));
+
 	exchange_mapi_util_mapi_id_from_string (fid, &priv->fid);
 	priv->olFolder = olFolder;
 
@@ -1191,6 +1194,31 @@
 		return status;
 }
 
+static uint32_t
+get_new_appt_id (ECalBackendMAPI *cbmapi)
+{
+	ECalBackendMAPIPrivate *priv = cbmapi->priv;
+	struct mapi_SRestriction res;
+	struct SPropValue sprop;
+	uint32_t id, count = 0x1;
+
+	res.rt = RES_PROPERTY;
+	res.res.resProperty.relop = RELOP_EQ;
+	res.res.resProperty.ulPropTag = PR_OWNER_APPT_ID;
+
+	while (count) {
+		id = g_random_int ();
+		if (id) {
+			set_SPropValue_proptag (&sprop, PR_OWNER_APPT_ID, (const void *) &id);
+			cast_mapi_SPropValue (&(res.res.resProperty.lpProp), &sprop);
+			count = exchange_mapi_util_check_restriction (priv->fid, &res);
+		}
+	}
+
+	return id;
+}
+
+
 static ECalBackendSyncStatus 
 e_cal_backend_mapi_create_object (ECalBackendSync *backend, EDataCal *cal, char **calobj, char **uid)
 {
@@ -1200,7 +1228,9 @@
 	ECalComponent *comp;
 	mapi_id_t mid = 0;
 	gchar *tmp = NULL;
+	GSList *recipients = NULL;
 	GSList *attachments = NULL;
+	struct cbdata cbdata;
 
 	cbmapi = E_CAL_BACKEND_MAPI (backend);
 	priv = cbmapi->priv;
@@ -1230,11 +1260,9 @@
 		return GNOME_Evolution_Calendar_OtherError;
 	}
 
-	/* FIXME: Add support for meetings/assigned tasks */
-	if (e_cal_component_has_attendees (comp)) {
-		g_object_unref (comp);
-		return GNOME_Evolution_Calendar_OtherError;
-	}
+	/* FIXME: [WIP] Add support for meetings/assigned tasks */
+	if (e_cal_component_has_attendees (comp)) 
+		e_cal_backend_mapi_util_fetch_recipients (cbmapi, comp, &recipients);
 
 	if (e_cal_component_has_attachments (comp))
 		e_cal_backend_mapi_util_fetch_attachments (cbmapi, comp, &attachments);
@@ -1244,12 +1272,18 @@
 		case CAL_MODE_ANY:
 		case CAL_MODE_REMOTE:
 			/* Create an appointment */
-			mid = exchange_mapi_create_item (priv->olFolder, priv->fid, mapi_cal_build_name_id, cbmapi, mapi_cal_build_props, comp, NULL, attachments, NULL);
+			cbdata.cbmapi = cbmapi;
+			cbdata.comp = comp;
+			cbdata.meeting_type = (recipients != NULL) ? MEETING_OBJECT : NOT_A_MEETING;
+			cbdata.msgflags = MSGFLAG_READ;
+			cbdata.new_appt_id = get_new_appt_id (cbmapi);
+			mid = exchange_mapi_create_item (priv->olFolder, priv->fid, mapi_cal_build_name_id, cbmapi, mapi_cal_build_props, &cbdata, recipients, attachments, NULL, MAPI_OPTIONS_DONT_SUBMIT);
 			if (!mid) {
 				g_object_unref (comp);
+				exchange_mapi_util_free_recipient_list (&recipients);
 				exchange_mapi_util_free_attachment_list (&attachments);
 				return GNOME_Evolution_Calendar_OtherError;
-			} 
+			}
 
 			tmp = exchange_mapi_util_mapi_id_to_string (mid);
 			e_cal_component_set_uid (comp, tmp);
@@ -1257,15 +1291,15 @@
 
 			e_cal_component_commit_sequence (comp);
 			e_cal_backend_cache_put_component (priv->cache, comp);
-			*calobj = e_cal_component_get_as_string (comp);	
+			*calobj = e_cal_component_get_as_string (comp);
 			e_cal_backend_notify_object_created (E_CAL_BACKEND (cbmapi), *calobj);
-
 			break;
 		default:
 			break;	
 	}
 
 	g_object_unref (comp);
+	exchange_mapi_util_free_recipient_list (&recipients);
 	exchange_mapi_util_free_attachment_list (&attachments);
 
 	return GNOME_Evolution_Calendar_Success;
@@ -1284,7 +1318,9 @@
 //	EGwConnectionStatus status;
 //	EGwItem *item, *cache_item;
 	const char *uid = NULL, *rid = NULL;
+	GSList *recipients = NULL;
 	GSList *attachments = NULL;
+	struct cbdata cbdata;
 
 	*old_object = *new_object = NULL;
 	cbmapi = E_CAL_BACKEND_MAPI (backend);
@@ -1310,11 +1346,9 @@
 		return GNOME_Evolution_Calendar_OtherError;
 	}
 
-	/* FIXME: Add support for meetings/assigned tasks */
-	if (e_cal_component_has_attendees (comp)) {
-		g_object_unref (comp);
-		return GNOME_Evolution_Calendar_OtherError;
-	}
+	/* FIXME: [WIP] Add support for meetings/assigned tasks */
+	if (e_cal_component_has_attendees (comp)) 
+		e_cal_backend_mapi_util_fetch_recipients (cbmapi, comp, &recipients);
 
 	if (e_cal_component_has_attachments (comp))
 		e_cal_backend_mapi_util_fetch_attachments (cbmapi, comp, &attachments);
@@ -1333,7 +1367,13 @@
 			return GNOME_Evolution_Calendar_ObjectNotFound;
 		}
 		exchange_mapi_util_mapi_id_from_string (uid, &mid);
-		status = exchange_mapi_modify_item (priv->olFolder, priv->fid, mid, mapi_cal_build_name_id, cbmapi, mapi_cal_build_props, comp, NULL, NULL);
+
+		cbdata.cbmapi = cbmapi;
+		cbdata.comp = comp;
+//		cbdata.meeting_type = (recipients != NULL) ? MEETING_OBJECT : NOT_A_MEETING;
+		cbdata.msgflags = MSGFLAG_READ;
+		cbdata.new_appt_id = 0x0;
+		status = exchange_mapi_modify_item (priv->olFolder, priv->fid, mid, mapi_cal_build_name_id, cbmapi, mapi_cal_build_props, &cbdata, NULL, NULL, MAPI_OPTIONS_DONT_SUBMIT);
 		if (!status) {
 			g_object_unref (comp);
 			g_object_unref (cache_comp);
@@ -1461,13 +1501,182 @@
 	return GNOME_Evolution_Calendar_Success;
 }
 
+static gboolean 
+capture_req_props (struct mapi_SPropValue_array *properties, const mapi_id_t fid, const mapi_id_t mid, 
+		   GSList *streams, GSList *recipients, GSList *attachments, gpointer data)
+{
+	struct cbdata *cbdata = (struct cbdata *) data;
+	const uint32_t *ui32;
+
+	ui32 = (const uint32_t *)find_mapi_SPropValue_data(properties, PR_OWNER_APPT_ID);
+	if (ui32)
+		cbdata->dup.owner_appt_id = *ui32;
+	ui32 = (const uint32_t *)find_mapi_SPropValue_data(properties, PROP_TAG(PT_LONG, 0x8201));
+	if (ui32)
+		cbdata->dup.appt_seq = *ui32;
+	cbdata->dup.cleanglobalid = (const struct SBinary *)find_mapi_SPropValue_data(properties, PROP_TAG(PT_BINARY, 0x0023));
+	cbdata->dup.globalid = (const struct SBinary *)find_mapi_SPropValue_data(properties, PROP_TAG(PT_BINARY, 0x0003));
+
+	return TRUE;
+}
+
+static void
+get_server_data (ECalBackendMAPI *cbmapi, icalcomponent *comp, struct cbdata *cbdata)
+{
+	ECalBackendMAPIPrivate *priv = cbmapi->priv;
+	const char *uid;
+	mapi_id_t mid;
+	struct mapi_SRestriction res;
+	struct SPropValue sprop;
+	struct SBinary sb;
+	uint32_t proptag = 0x00000000;
+	struct SPropTagArray *array;
+
+	uid = icalcomponent_get_uid (comp);
+	exchange_mapi_util_mapi_id_from_string (uid, &mid);
+	if (exchange_mapi_connection_fetch_item (priv->fid, mid, 
+					NULL, 0, 
+					NULL, NULL, 
+					capture_req_props, cbdata, 
+					MAPI_OPTIONS_FETCH_GENERIC_STREAMS))
+
+		return;
+
+	array = exchange_mapi_util_resolve_named_prop (priv->olFolder, priv->fid, 0x0023, PSETID_Meeting);
+	proptag = array->aulPropTag[0];
+
+	res.rt = RES_PROPERTY;
+	res.res.resProperty.relop = RELOP_EQ;
+	res.res.resProperty.ulPropTag = proptag;
+
+	e_cal_backend_mapi_util_generate_globalobjectid (TRUE, uid, &sb);
+
+	set_SPropValue_proptag (&sprop, proptag, (const void *) &sb);
+	cast_mapi_SPropValue (&(res.res.resProperty.lpProp), &sprop);
+
+	exchange_mapi_connection_fetch_items (priv->fid, &res, 
+					NULL, 0, 
+					NULL, NULL, 
+					capture_req_props, cbdata, 
+					MAPI_OPTIONS_FETCH_GENERIC_STREAMS);
+}
+
 static ECalBackendSyncStatus 
 e_cal_backend_mapi_send_objects (ECalBackendSync *backend, EDataCal *cal, const char *calobj, 
 				 GList **users, char **modified_calobj)
 {
+	ECalBackendSyncStatus status = GNOME_Evolution_Calendar_OtherError;
+	ECalBackendMAPI *cbmapi;
+	ECalBackendMAPIPrivate *priv;
+	icalcomponent *icalcomp;
 
-	return GNOME_Evolution_Calendar_Success;
+	cbmapi = E_CAL_BACKEND_MAPI (backend);
+	priv = cbmapi->priv;
+
+	g_return_val_if_fail (E_IS_CAL_BACKEND_MAPI (cbmapi), GNOME_Evolution_Calendar_InvalidObject);
+	g_return_val_if_fail (calobj != NULL, GNOME_Evolution_Calendar_InvalidObject);
+
+	if (priv->mode == CAL_MODE_LOCAL)
+		return GNOME_Evolution_Calendar_RepositoryOffline;
 
+	/* check the component for validity */
+	icalcomp = icalparser_parse_string (calobj);
+	if (!icalcomp)
+		return GNOME_Evolution_Calendar_InvalidObject;
+
+	*modified_calobj = NULL;
+	*users = NULL;
+
+	if (icalcomponent_isa (icalcomp) == ICAL_VCALENDAR_COMPONENT) {
+		icalproperty_method method = icalcomponent_get_method (icalcomp);
+		icalcomponent *subcomp = icalcomponent_get_first_component (icalcomp,
+							     e_cal_backend_get_kind (E_CAL_BACKEND (backend)));
+		while (subcomp) {
+			ECalComponent *comp = e_cal_component_new ();
+			struct cbdata cbdata;
+			mapi_id_t mid = 0;
+			GSList *recipients = NULL;
+			GSList *attachments = NULL;
+
+			e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (subcomp));
+
+			/* FIXME: Add support for recurrences */
+			if (e_cal_component_has_recurrences (comp)) {
+				g_object_unref (comp);
+				return GNOME_Evolution_Calendar_OtherError;
+			}
+
+			/* FIXME: [WIP] Add support for meetings/assigned tasks */
+			if (e_cal_component_has_attendees (comp)) {
+				e_cal_backend_mapi_util_fetch_recipients (cbmapi, comp, &recipients);
+				method = icalcomponent_get_method (icalcomp);
+			}
+
+			if (e_cal_component_has_attachments (comp))
+				e_cal_backend_mapi_util_fetch_attachments (cbmapi, comp, &attachments);
+
+			cbdata.cbmapi = cbmapi;
+			cbdata.comp = comp;
+			cbdata.new_appt_id = 0x0;
+			switch (method) {
+			case ICAL_METHOD_REQUEST : 
+				cbdata.meeting_type = MEETING_REQUEST;
+				cbdata.msgflags = MSGFLAG_UNSENT ;
+				break;
+			case ICAL_METHOD_RESPONSE : 
+				cbdata.meeting_type = MEETING_RESPONSE;
+				cbdata.msgflags = MSGFLAG_UNSENT;
+				break;
+			default :
+				cbdata.meeting_type = NOT_A_MEETING;
+				cbdata.msgflags = MSGFLAG_READ;
+				break;
+			}
+
+			get_server_data (cbmapi, subcomp, &cbdata);
+
+			mid = exchange_mapi_create_item (olFolderOutbox, 0, mapi_cal_build_name_id, cbmapi, mapi_cal_build_props, &cbdata, recipients, attachments, NULL, 0);
+			if (!mid) {
+				g_object_unref (comp);
+				exchange_mapi_util_free_recipient_list (&recipients);
+				exchange_mapi_util_free_attachment_list (&attachments);
+				return GNOME_Evolution_Calendar_OtherError;
+			} else 
+				status = GNOME_Evolution_Calendar_Success;
+
+			g_object_unref (comp);
+			exchange_mapi_util_free_recipient_list (&recipients);
+			exchange_mapi_util_free_attachment_list (&attachments);
+
+			subcomp = icalcomponent_get_next_component (icalcomp,
+								    e_cal_backend_get_kind (E_CAL_BACKEND (backend)));
+		}
+	}
+
+	if (status == GNOME_Evolution_Calendar_Success) {
+		ECalComponent *comp;
+
+		comp = e_cal_component_new ();
+
+		if (e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (icalcomp))) {
+			GSList *attendee_list = NULL, *tmp;
+			e_cal_component_get_attendee_list (comp, &attendee_list);
+			/* convert this into GList */
+			for (tmp = attendee_list; tmp; tmp = g_slist_next (tmp)) {
+				const char *attendee = tmp->data;
+
+				if (attendee)
+					*users = g_list_append (*users, g_strdup (attendee));
+			}
+
+			g_object_unref (comp);
+		}
+		*modified_calobj = g_strdup (calobj);
+	}
+
+	icalcomponent_free (icalcomp);
+
+	return GNOME_Evolution_Calendar_Success;
 }
 
 static ECalBackendSyncStatus 
@@ -1919,3 +2128,42 @@
 	return priv->local_attachments_store;
 }
 
+const char *	
+e_cal_backend_mapi_get_owner_name (ECalBackendMAPI *cbmapi)
+{
+	ECalBackendMAPIPrivate *priv;
+
+	priv = cbmapi->priv;
+
+	return priv->owner_name;
+}
+
+const char *	
+e_cal_backend_mapi_get_owner_email (ECalBackendMAPI *cbmapi)
+{
+	ECalBackendMAPIPrivate *priv;
+
+	priv = cbmapi->priv;
+
+	return priv->owner_email;
+}
+
+const char *	
+e_cal_backend_mapi_get_user_name (ECalBackendMAPI *cbmapi)
+{
+	ECalBackendMAPIPrivate *priv;
+
+	priv = cbmapi->priv;
+
+	return priv->user_name;
+}
+
+const char *	
+e_cal_backend_mapi_get_user_email (ECalBackendMAPI *cbmapi)
+{
+	ECalBackendMAPIPrivate *priv;
+
+	priv = cbmapi->priv;
+
+	return priv->user_email;
+}

Modified: branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi.h
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi.h	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/calendar/backends/mapi/e-cal-backend-mapi.h	Sun Jun 29 06:04:50 2008
@@ -1,21 +1,24 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ *  Authors: 
+ *    Suman Manjunath <msuman novell com>
  *
- *  Suman Manjunath <msuman novell com>
- *  Copyright (C) 2007 Novell, Inc.
+ *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  *
  *  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.
+ *  it under the terms of version 2 of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation.
  *
  *  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.
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public 
+ *  License along with this program; if not, write to: 
+ *  Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
  *
- *  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.
  */
 
 
@@ -37,9 +40,10 @@
 #include <glib.h>
 #include <glib/gi18n.h>
 
-#include "exchange-mapi-connection.h"
-#include "exchange-mapi-folder.h"
-#include "exchange-mapi-utils.h"
+#include <exchange-mapi-connection.h>
+#include <exchange-mapi-defs.h>
+#include <exchange-mapi-folder.h>
+#include <exchange-mapi-utils.h>
 
 #if 0
 #include <stdio.h>
@@ -78,6 +82,40 @@
 const char *	
 e_cal_backend_mapi_get_local_attachments_store (ECalBackendMAPI *cbmapi);
 
+const char *	
+e_cal_backend_mapi_get_owner_name (ECalBackendMAPI *cbmapi);
+const char *	
+e_cal_backend_mapi_get_owner_email (ECalBackendMAPI *cbmapi);
+
+const char *	
+e_cal_backend_mapi_get_user_name (ECalBackendMAPI *cbmapi);
+const char *	
+e_cal_backend_mapi_get_user_email (ECalBackendMAPI *cbmapi);
+
+typedef enum {
+	NOT_A_MEETING = 0, 
+	MEETING_OBJECT = (1 << 0),
+	MEETING_OBJECT_SENT = (1 << 1),
+	MEETING_REQUEST = (1 << 2), 
+	MEETING_RESPONSE = (1 << 3)
+} MAPIMeetingOptions;
+
+struct dup_data {
+	struct SBinary *globalid;
+	struct SBinary *cleanglobalid;
+	uint32_t owner_appt_id;
+	uint32_t appt_seq;
+};
+
+struct cbdata { 
+	ECalBackendMAPI *cbmapi;
+	ECalComponent *comp;
+	MAPIMeetingOptions meeting_type;
+	uint32_t msgflags;
+	uint32_t new_appt_id;
+	struct dup_data dup;
+};
+
 G_END_DECLS
 
 #endif

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	Sun Jun 29 06:04:50 2008
@@ -156,12 +156,11 @@
 
 }
 
-/* here, there is no point setting 'out' param */
 static gboolean
 fetch_items_cb (struct mapi_SPropValue_array *array, const mapi_id_t fid, const mapi_id_t mid, 
-		GSList *streams, GSList *recipients, GSList *attachments, gpointer in, gpointer out)
+		GSList *streams, GSList *recipients, GSList *attachments, gpointer data)
 {
-	CamelMapiFolder *mapi_folder = CAMEL_MAPI_FOLDER(in);
+	CamelMapiFolder *mapi_folder = CAMEL_MAPI_FOLDER(data);
 	GSList *slist = mapi_folder->priv->item_list;
 	long *flags;
 	struct FILETIME *delivery_date;
@@ -541,9 +540,11 @@
 			goto end2;
 		}
 
-		status = exchange_mapi_connection_fetch_items (temp_folder_id, summary_prop_list, 
-							       G_N_ELEMENTS (summary_prop_list), NULL, NULL, 
-							       fetch_items_cb, folder, 0);
+		status = exchange_mapi_connection_fetch_items  (temp_folder_id, NULL, 
+								summary_prop_list, G_N_ELEMENTS (summary_prop_list), 
+								NULL, NULL, 
+								fetch_items_cb, folder, 
+								0);
 
 		if (!status) {
 			camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_INVALID, _("Fetch items failed"));
@@ -572,11 +573,9 @@
 
 }
 
-/* In a fetch_item_callback, the data would be returned with the 'out' param, 
- * while the 'in' param would always be NULL */
 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 in, gpointer out)
+		GSList *streams, GSList *recipients, GSList *attachments, gpointer data)
 {
 	exchange_mapi_debug_property_dump (array);
 	long *flags;
@@ -616,7 +615,7 @@
 	printf("%s(%d):%s:Number of Attachments : %d \n", __FILE__, __LINE__, __PRETTY_FUNCTION__, g_slist_length (attachments));
 	item->attachments = attachments;
 
-	out = item; 
+	data = item; 
 	return TRUE;
 }
 
@@ -853,14 +852,16 @@
 
 	mapi_id_t id_folder;
 	mapi_id_t id_message;
-	MapiItem *item;
+	MapiItem *item = NULL;
 
 	exchange_mapi_util_mapi_ids_from_uid (uid, &id_folder, &id_message);
 
 	folder_id =  g_strdup (camel_mapi_store_folder_id_lookup (mapi_store, folder->full_name)) ;
-	item = exchange_mapi_connection_fetch_item (id_folder, id_message, NULL, 0, 
-						    NULL, fetch_item_cb, NULL, 
-						    MAPI_OPTIONS_FETCH_ATTACHMENTS | MAPI_OPTIONS_FETCH_BODY_STREAM | MAPI_OPTIONS_FETCH_BODY_STREAM);
+	exchange_mapi_connection_fetch_item (id_folder, id_message, 
+					NULL, 0, 
+					NULL, NULL, 
+					fetch_item_cb, item, 
+					MAPI_OPTIONS_FETCH_ATTACHMENTS | MAPI_OPTIONS_FETCH_BODY_STREAM | MAPI_OPTIONS_FETCH_BODY_STREAM);
 
 	if (item == NULL) {
 		camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_INVALID, _("Could not get message"));

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	Sun Jun 29 06:04:50 2008
@@ -1,23 +1,25 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ *  Authors: 
+ *    Srinivasa Ragavan <sragavan novell com>
+ *    Suman Manjunath <msuman novell com>
  *
- *  Authors:
- *  	Srinivasa Ragavan <sragavan novell com>
- *  	Suman Manjunath <msuman novell com>
- *  Copyright (C) 2007 Novell, Inc.
+ *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  *
  *  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.
+ *  it under the terms of version 2 of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation.
  *
  *  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.
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public 
+ *  License along with this program; if not, write to: 
+ *  Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
  *
- *  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.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -832,7 +834,7 @@
 	const char 		**users = NULL;
 	uint32_t 		i, j, count = 0;
 
-	SPropTagArray = set_SPropTagArray(mem_ctx, 0x6,
+	SPropTagArray = set_SPropTagArray(mem_ctx, 0x7,
 					  PR_DISPLAY_TYPE,
 					  PR_OBJECT_TYPE, 
 //					  PR_ADDRTYPE,
@@ -840,7 +842,8 @@
 					  PR_SMTP_ADDRESS,
 					  PR_DISPLAY_NAME,
 					  PR_GIVEN_NAME,
-					  PR_SURNAME);
+					  PR_SURNAME, 
+					  PR_7BIT_DISPLAY_NAME);
 //					  PR_ENTRYID,
 //					  PR_SEARCH_KEY,
 //					  PR_TRANSMITTABLE_DISPLAY_NAME);
@@ -902,14 +905,106 @@
 	g_free (users);
 }
 
+guint32
+exchange_mapi_util_check_restriction (mapi_id_t fid, struct mapi_SRestriction *res)
+{
+	enum MAPISTATUS retval;
+	TALLOC_CTX *mem_ctx;
+	mapi_object_t obj_store;
+	mapi_object_t obj_folder;
+	mapi_object_t obj_table;
+	struct SPropTagArray *SPropTagArray, *GetPropsTagArray;
+	uint32_t count = 0;
+
+	d(g_print("%s(%d): Entering %s: folder-id %016llX \n", __FILE__, __LINE__, __PRETTY_FUNCTION__, fid));
+
+	LOCK ();
+	mem_ctx = talloc_init("ExchangeMAPI_CheckRestriction");
+	mapi_object_init(&obj_store);
+	mapi_object_init(&obj_folder);
+	mapi_object_init(&obj_table);
+
+	/* Open the message store */
+	retval = OpenMsgStore(&obj_store);
+	if (retval != MAPI_E_SUCCESS) {
+		mapi_errstr("OpenMsgStore", GetLastError());
+		goto cleanup;
+	}
+
+	/* Attempt to open the folder */
+	retval = OpenFolder(&obj_store, fid, &obj_folder);
+	if (retval != MAPI_E_SUCCESS) {
+		mapi_errstr("OpenFolder", GetLastError());
+		goto cleanup;
+	}
+
+	/* Get a handle on the container */
+	retval = GetContentsTable(&obj_folder, &obj_table, 0, NULL);
+	if (retval != MAPI_E_SUCCESS) {
+		mapi_errstr("GetContentsTable", GetLastError());
+		goto cleanup;
+	}
+
+	GetPropsTagArray = talloc_zero(mem_ctx, struct SPropTagArray);
+	GetPropsTagArray->cValues = 0;
+
+	// FIXME : Why are we fetching all these props ?
+
+	SPropTagArray = set_SPropTagArray(mem_ctx, 0xA,
+					  PR_FID,
+					  PR_MID,
+					  PR_INST_ID,
+					  PR_INSTANCE_NUM,
+					  PR_SUBJECT,
+					  PR_MESSAGE_CLASS,
+					  PR_LAST_MODIFICATION_TIME,
+					  PR_HASATTACH,
+					  PR_RULE_MSG_PROVIDER,
+					  PR_RULE_MSG_NAME);
+
+	/* Set primary columns to be fetched */
+	retval = SetColumns(&obj_table, SPropTagArray);
+	if (retval != MAPI_E_SUCCESS) {
+		mapi_errstr("SetColumns", GetLastError());
+		goto cleanup;
+	}
+
+	if (res) {
+		/* Applying any restriction that are set. */
+		retval = Restrict(&obj_table, res);
+		if (retval != MAPI_E_SUCCESS) {
+			mapi_errstr("Restrict", GetLastError());
+			goto cleanup;
+		}
+	}
+
+	/* Number of items in the container */
+	retval = GetRowCount(&obj_table, &count);
+	if (retval != MAPI_E_SUCCESS) {
+		mapi_errstr("GetRowCount", GetLastError());
+		goto cleanup;
+	}
+
+cleanup:
+	mapi_object_release(&obj_folder);
+	mapi_object_release(&obj_table);
+	mapi_object_release(&obj_store);
+	talloc_free (mem_ctx);
+	UNLOCK ();
+
+	d(g_print("%s(%d): Leaving %s \n", __FILE__, __LINE__, __PRETTY_FUNCTION__));
+
+	return count;
+}
+
 // FIXME: May be we need to support Restrictions/Filters here. May be after libmapi-0.7.
 gboolean
 exchange_mapi_connection_fetch_items   (mapi_id_t fid, 
-					const uint32_t *GetPropsList, const uint16_t cn_props, 
-					BuildNameID build_name_id, 
 					struct mapi_SRestriction *res,
-					FetchCallback cb, 
-					gpointer data, guint32 options)
+					const uint32_t *GetPropsList, const uint16_t cn_props, 
+					BuildNameID build_name_id, gpointer build_name_data, 
+					FetchCallback cb, gpointer data, 
+					guint32 options)
 {
 	enum MAPISTATUS retval;
 	TALLOC_CTX *mem_ctx;
@@ -1008,7 +1103,7 @@
 		NamedPropsTagArray->cValues = 0;
 		/* Add named props using callback */
 		if (build_name_id) {
-			if (!build_name_id (nameid, data)) {
+			if (!build_name_id (nameid, build_name_data)) {
 				g_warning ("%s(%d): (%s): Could not build named props \n", __FILE__, __LINE__, __PRETTY_FUNCTION__);
 				goto GetProps_cleanup;
 			}
@@ -1098,7 +1193,7 @@
 			mapi_SPropValue_array_named(&obj_message, &properties_array);
 
 			/* NOTE: stream_list, recipient_list and attach_list should be freed by the callback */
-			if (!cb (&properties_array, *pfid, *pmid, stream_list, recip_list, attach_list, data, NULL)) {
+			if (!cb (&properties_array, *pfid, *pmid, stream_list, recip_list, attach_list, data)) {
 				g_warning ("%s(%d): %s: Callback failed for message-id %016llX \n", __FILE__, __LINE__, __PRETTY_FUNCTION__, *pmid);
 			}
 		}
@@ -1124,11 +1219,12 @@
 	return result;
 }
 
-gpointer
+gboolean
 exchange_mapi_connection_fetch_item (mapi_id_t fid, mapi_id_t mid, 
 				     const uint32_t *GetPropsList, const uint16_t cn_props, 
-				     BuildNameID build_name_id, FetchCallback cb, 
-				     gpointer data, guint32 options)
+				     BuildNameID build_name_id, gpointer build_name_data, 
+				     FetchCallback cb, gpointer data, 
+				     guint32 options)
 {
 	enum MAPISTATUS retval;
 	TALLOC_CTX *mem_ctx;
@@ -1140,7 +1236,7 @@
 	GSList *attach_list = NULL;
 	GSList *recip_list = NULL;
 	GSList *stream_list = NULL;
-	gpointer retobj = NULL;
+	gboolean result = FALSE;
 
 	d(g_print("%s(%d): Entering %s: folder-id %016llX message-id %016llX \n", __FILE__, __LINE__, __PRETTY_FUNCTION__, fid, mid));
 
@@ -1178,7 +1274,7 @@
 		NamedPropsTagArray->cValues = 0;
 		/* Add named props using callback */
 		if (build_name_id) {
-			if (!build_name_id (nameid, data)) {
+			if (!build_name_id (nameid, build_name_data)) {
 				g_warning ("%s(%d): (%s): Could not build named props \n", __FILE__, __LINE__, __PRETTY_FUNCTION__);
 				goto GetProps_cleanup;
 			}
@@ -1251,12 +1347,14 @@
 		mapi_SPropValue_array_named(&obj_message, &properties_array);
 
 		/* NOTE: stream_list, recipient_list and attach_list should be freed by the callback */
-		cb (&properties_array, fid, mid, stream_list, recip_list, attach_list, NULL, &retobj);
+		cb (&properties_array, fid, mid, stream_list, recip_list, attach_list, data);
 	}
 
 //	if (GetPropsTagArray->cValues) 
 //		talloc_free (properties_array.lpProps);
 
+	result = TRUE;
+
 cleanup:
 	mapi_object_release(&obj_message);
 	mapi_object_release(&obj_folder);
@@ -1266,7 +1364,7 @@
 
 	d(g_print("%s(%d): Leaving %s \n", __FILE__, __LINE__, __PRETTY_FUNCTION__));
 
-	return retobj;
+	return result;
 }
 
 

Modified: branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-connection.h
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-connection.h	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-connection.h	Sun Jun 29 06:04:50 2008
@@ -1,23 +1,25 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ *  Authors: 
+ *    Srinivasa Ragavan <sragavan novell com>
+ *    Suman Manjunath <msuman novell com>
  *
- *  Authors:
- *  	Srinivasa Ragavan <sragavan novell com>
- *  	Suman Manjunath <msuman novell com>
- *  Copyright (C) 2007 Novell, Inc.
+ *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  *
  *  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.
+ *  it under the terms of version 2 of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation.
  *
  *  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.
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public 
+ *  License along with this program; if not, write to: 
+ *  Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
  *
- *  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 EXCHANGE_MAPI_CONNECTION_H
@@ -88,7 +90,7 @@
 };
 
 typedef gboolean (*FetchCallback) 	(struct mapi_SPropValue_array *, const mapi_id_t fid, const mapi_id_t mid, 
-					GSList *streams, GSList *recipients, GSList *attachments, gpointer in, gpointer out);
+					GSList *streams, GSList *recipients, GSList *attachments, gpointer data);
 typedef gboolean (*BuildNameID) 	(struct mapi_nameid *nameid, gpointer data);
 typedef int 	 (*BuildProps) 		(struct SPropValue **, struct SPropTagArray *, gpointer data);
 
@@ -101,16 +103,19 @@
 gboolean
 exchange_mapi_connection_exists (void);
 
-gpointer
+gboolean
 exchange_mapi_connection_fetch_item (mapi_id_t fid, mapi_id_t mid, 
 				     const uint32_t *GetPropsList, const uint16_t cn_props, 
-				     BuildNameID build_name_id, FetchCallback cb, 
-				     gpointer data, guint32 options);
+				     BuildNameID build_name_id, gpointer build_name_data, 
+				     FetchCallback cb, gpointer data, 
+				     guint32 options);
 gboolean
-exchange_mapi_connection_fetch_items (mapi_id_t fid, 
-				      const uint32_t *GetPropsList, const uint16_t cn_props, BuildNameID build_name_id,  
-				      struct mapi_SRestriction *res, 
-				      FetchCallback cb, gpointer data, guint32 options);
+exchange_mapi_connection_fetch_items   (mapi_id_t fid, 
+					struct mapi_SRestriction *res,
+					const uint32_t *GetPropsList, const uint16_t cn_props, 
+					BuildNameID build_name_id, gpointer build_name_data, 
+					FetchCallback cb, gpointer data, 
+					guint32 options);
 
 mapi_id_t 
 exchange_mapi_create_folder (uint32_t olFolder, mapi_id_t pfid, const char *name);
@@ -119,6 +124,9 @@
 gboolean 
 exchange_mapi_rename_folder (mapi_id_t fid, const char *new_name);
 
+guint32
+exchange_mapi_util_check_restriction (mapi_id_t fid, struct mapi_SRestriction *res);
+
 mapi_id_t
 exchange_mapi_create_item (uint32_t olFolder, mapi_id_t fid, 
 			   BuildNameID build_name_id, gpointer ni_data, 

Modified: branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-defs.h
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-defs.h	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-defs.h	Sun Jun 29 06:04:50 2008
@@ -1,22 +1,24 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ *  Authors: 
+ *    Suman Manjunath <msuman novell com>
  *
- *  Authors:
- *  	Suman Manjunath <msuman novell com>
- *  Copyright (C) 2008 Novell, Inc.
+ *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  *
  *  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.
+ *  it under the terms of version 2 of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation.
  *
  *  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.
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public 
+ *  License along with this program; if not, write to: 
+ *  Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
  *
- *  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.
  */
 
 
@@ -74,6 +76,13 @@
 
 #if 0
 typedef enum {
+    olEditorText = 1,
+    olEditorHTML = 2,
+    olEditorRTF = 3,
+    olEditorWord = 4
+} OlEditorType; /* PR_MESSAGE_EDITOR_FORMAT type */
+
+typedef enum {
     olFolderDeletedItems = 3,
     olFolderOutbox = 4,
     olFolderSentMail = 5,
@@ -164,14 +173,6 @@
     olTaskDelegationDeclined = 3
 } OlTaskDelegationState;
 
-#if 0
-typedef enum {
-    olNewTask = 0,
-    olDelegatedTask = 1,
-    olOwnTask = 2
-} OlTaskOwnership;
-#endif
-
 typedef enum {
     olUpdate = 2,
     olFinalStatus = 3
@@ -186,6 +187,12 @@
 
 #if 0
 typedef enum {
+    olNewTask = 0,
+    olDelegatedTask = 1,
+    olOwnTask = 2
+} OlTaskOwnership;
+
+typedef enum {
     olTaskNotStarted = 0,
     olTaskInProgress = 1,
     olTaskComplete = 2,
@@ -208,6 +215,14 @@
 
 
 /* RECURRENCE (APPOINTMENTS/MEETINGS/TASKS) */
+typedef enum { 
+    rectypeNone = 0,
+    rectypeDaily = 1,
+    rectypeWeekly = 2,
+    rectypeMonthly = 3,
+    rectypeYearly = 4
+} OlRecurrenceType;
+
 typedef enum {
     olApptNotRecurring = 0,
     olApptMaster = 1,
@@ -222,7 +237,7 @@
     olRecursMonthNth = 3,
     olRecursYearly = 5,
     olRecursYearNth = 6
-} OlRecurrenceType;
+} OlRecurrencePatternType;
 
 
 G_END_DECLS

Modified: branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-folder.c
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-folder.c	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-folder.c	Sun Jun 29 06:04:50 2008
@@ -1,21 +1,24 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ *  Authors: 
+ *    Srinivasa Ragavan <sragavan novell com>
  *
- *  Srinivasa Ragavan <sragavan novell com>
- *  Copyright (C) 2007 Novell, Inc.
+ *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  *
  *  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.
+ *  it under the terms of version 2 of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation.
  *
  *  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.
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public 
+ *  License along with this program; if not, write to: 
+ *  Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
  *
- *  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.
  */
 
 

Modified: branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-folder.h
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-folder.h	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-folder.h	Sun Jun 29 06:04:50 2008
@@ -1,21 +1,24 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ *  Authors: 
+ *    Srinivasa Ragavan <sragavan novell com>
  *
- *  Srinivasa Ragavan <sragavan novell com>
- *  Copyright (C) 2007 Novell, Inc.
+ *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  *
  *  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.
+ *  it under the terms of version 2 of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation.
  *
  *  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.
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public 
+ *  License along with this program; if not, write to: 
+ *  Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
  *
- *  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 EXCHANGE_MAPI_FOLDER_H

Modified: branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-utils.c
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-utils.c	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-utils.c	Sun Jun 29 06:04:50 2008
@@ -1,21 +1,24 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ *  Authors: 
+ *    Suman Manjunath <msuman novell com>
  *
- *  Suman Manjunath <msuman novell com>
- *  Copyright (C) 2007 Novell, Inc.
+ *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  *
  *  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.
+ *  it under the terms of version 2 of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation.
  *
  *  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.
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public 
+ *  License along with this program; if not, write to: 
+ *  Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
  *
- *  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.
  */
 
 

Modified: branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-utils.h
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-utils.h	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-utils.h	Sun Jun 29 06:04:50 2008
@@ -1,21 +1,24 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ *  Authors: 
+ *    Suman Manjunath <msuman novell com>
  *
- *  Suman Manjunath <msuman novell com>
- *  Copyright (C) 2007 Novell, Inc.
+ *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  *
  *  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.
+ *  it under the terms of version 2 of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation.
  *
  *  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.
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public 
+ *  License along with this program; if not, write to: 
+ *  Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
  *
- *  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.
  */
 
 



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