[evolution-mapi/gnome-2-32] Bug #630698 - Cannot remove just created folder



commit f17347626eaef6b66a1bc38b1f58f4b723e6e49b
Author: Punit Jain <jpunit novell com>
Date:   Tue Oct 12 11:47:25 2010 +0200

    Bug #630698 - Cannot remove just created folder

 src/libexchangemapi/exchange-mapi-connection.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/src/libexchangemapi/exchange-mapi-connection.c b/src/libexchangemapi/exchange-mapi-connection.c
index feb2951..0ad3a55 100644
--- a/src/libexchangemapi/exchange-mapi-connection.c
+++ b/src/libexchangemapi/exchange-mapi-connection.c
@@ -2012,6 +2012,14 @@ exchange_mapi_connection_create_folder (ExchangeMapiConnection *conn, uint32_t o
 
 	fid = mapi_object_get_id (&obj_folder);
 	g_debug("Folder %s created with id %016" G_GINT64_MODIFIER "X ", name, fid);
+	
+	/* we should also update folder list locally */
+	if (fid != 0 && priv->folders != NULL) {
+		ExchangeMAPIFolder *folder = NULL;
+		folder = exchange_mapi_folder_new (name, type, MAPI_PERSONAL_FOLDER, fid, pfid, 0, 0, 0);
+		if (folder)
+			priv->folders = g_slist_append (priv->folders, folder);
+	}
 
 cleanup:
 	mapi_object_release(&obj_folder);
@@ -2079,13 +2087,16 @@ exchange_mapi_connection_remove_folder (ExchangeMapiConnection *conn, mapi_id_t
 	CHECK_CORRECT_CONN_AND_GET_PRIV (conn, FALSE);
 	e_return_val_mapi_error_if_fail (priv->session != NULL, MAPI_E_INVALID_PARAMETER, FALSE);
 
+	g_return_val_if_fail (fid != 0, FALSE);
+
 	g_debug("%s: Entering %s ", G_STRLOC, G_STRFUNC);
 
 	folder = NULL;
-	for (l = exchange_mapi_connection_peek_folders_list (conn); l && !folder; l = l->next) {
+	for (l = exchange_mapi_connection_peek_folders_list (conn); l; l = l->next) {
 		folder = l->data;
-
-		if (!folder || !folder->folder_id || folder->folder_id != fid)
+		if (folder && folder->folder_id == fid)
+			break;
+		else
 			folder = NULL;
 	}
 



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