evolution-data-server r9054 - branches/EXCHANGE_MAPI_BRANCH/servers/mapi



Author: jjohnny
Date: Thu Jun 26 10:39:10 2008
New Revision: 9054
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9054&view=rev

Log:
Fixes for API changes in libmapi.


Modified:
   branches/EXCHANGE_MAPI_BRANCH/servers/mapi/ChangeLog
   branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-connection.c

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	Thu Jun 26 10:39:10 2008
@@ -945,7 +945,7 @@
 	}
 
 	/* Get a handle on the container */
-	retval = GetContentsTable(&obj_folder, &obj_table);
+	retval = GetContentsTable(&obj_folder, &obj_table, 0, NULL);
 	if (retval != MAPI_E_SUCCESS) {
 		mapi_errstr("GetContentsTable", GetLastError());
 		goto cleanup;
@@ -1666,8 +1666,7 @@
 
 	nameid[0].lpguid = guid;
 	nameid[0].ulKind = MNID_STRING;
-	nameid[0].kind.lpwstr.lpwstrName = named_prop_name;
-	nameid[0].kind.lpwstr.length = strlen(named_prop_name) * 2 + 2;
+	nameid[0].kind.lpwstr.Name = named_prop_name;
 
 	/* Open the message store */
 	retval = OpenMsgStore(&obj_store);
@@ -1985,6 +1984,9 @@
 	struct SPropValue *props = NULL;
 	gint propslen = 0;
 	gboolean result = FALSE;
+	mapi_id_t* messageIds = NULL;
+	gint16 messageIdCount = 0;
+	guint i;
 	GSList *l;
 
 	LOCK ();
@@ -2007,24 +2009,17 @@
 		goto cleanup;
 	}
 
-	for (l = mid_list; l != NULL; l = g_slist_next (l)) {
-		mapi_object_init(&obj_message);
-		mapi_id_t mid = *((mapi_id_t *)l->data);
-
-		retval = OpenMessage(&obj_folder, fid, mid, &obj_message, MAPI_MODIFY);
+	messageIdCount = g_slist_length (mid_list);
+	messageIds = g_malloc0 (messageIdCount * sizeof (mapi_id_t));
 
-		if (retval != MAPI_E_SUCCESS) {
-			mapi_errstr("OpenMessage", GetLastError());
-			goto cleanup;
-		}
+	for (i = 0, l = mid_list; l != NULL; l = g_slist_next (l), i++) 
+		messageIds[i] = *((mapi_id_t *)l->data);
 
-		retval = SetReadFlags(&obj_folder, &obj_message, flag);
-		if (retval != MAPI_E_SUCCESS) {
-			mapi_errstr("SetReadFlags", GetLastError());
-			goto cleanup;
-		}
+	retval = SetReadFlags(&obj_folder, flag, messageIdCount, messageIds);
 
-		mapi_object_release(&obj_message);
+	if (retval != MAPI_E_SUCCESS) {
+		mapi_errstr("SetReadFlags", GetLastError());
+		goto cleanup;
 	}
 
 	result = TRUE;
@@ -2130,7 +2125,7 @@
 		goto cleanup;
 	}
 
-	retval = GetHierarchyTable(&obj_folder, &obj_htable);
+	retval = GetHierarchyTable(&obj_folder, &obj_htable, 0, NULL);
 	if (retval != MAPI_E_SUCCESS) {
 		mapi_errstr("GetHierarchyTable", GetLastError());
 		goto cleanup;
@@ -2216,7 +2211,7 @@
 	}
 
 	/* Get the hierarchy table */
-	retval = GetHierarchyTable(&obj_folder, &obj_table);
+	retval = GetHierarchyTable(&obj_folder, &obj_table, 0, NULL);
 	if (retval != MAPI_E_SUCCESS) {
 		mapi_errstr("GetHierarchyTable", GetLastError());
 		goto cleanup;



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