[evolution-mapi] Bug #596208 - Doesn't remove folders that were deleted/moved on the exchange-server



commit 47ad4425816054c0f85203372b58d4247fbd6967
Author: Johnny Jacob <jjohnny novell com>
Date:   Wed Oct 28 23:41:46 2009 +0530

    Bug #596208 - Doesn't remove folders that were deleted/moved on the exchange-server

 src/camel/camel-mapi-store.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/src/camel/camel-mapi-store.c b/src/camel/camel-mapi-store.c
index 18e53e5..9f5aa37 100644
--- a/src/camel/camel-mapi-store.c
+++ b/src/camel/camel-mapi-store.c
@@ -1214,6 +1214,8 @@ mapi_folders_sync (CamelMapiStore *store, const char *top, guint32 flags, CamelE
 	gboolean subscription_list = FALSE;
 	CamelFolderInfo *info = NULL;
 	CamelMapiStoreInfo *mapi_si = NULL;
+	guint32 count, i;
+	CamelStoreInfo *si = NULL;
 
 	if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_AVAIL) {
 		if (((CamelService *)store)->status == CAMEL_SERVICE_DISCONNECTED){
@@ -1320,6 +1322,22 @@ mapi_folders_sync (CamelMapiStore *store, const char *top, guint32 flags, CamelE
 		mapi_si->info.unread = info->unread;
 	}
 
+	/* Weed out deleted folders*/
+	count = camel_store_summary_count ((CamelStoreSummary *)store->summary);
+	for (i=0;i<count;i++) {
+		si = camel_store_summary_index ((CamelStoreSummary *)store->summary, i);
+		if (si == NULL)
+			continue;
+
+		info = g_hash_table_lookup (priv->name_hash, camel_store_info_path (store->summary, si));
+		if (!info) {
+			camel_store_summary_remove ((CamelStoreSummary *)store->summary, si);
+		}
+
+		camel_store_summary_info_free ((CamelStoreSummary *)store->summary, si);
+	}
+
+
 	camel_store_summary_touch ((CamelStoreSummary *)store->summary);
 	camel_store_summary_save ((CamelStoreSummary *)store->summary);
 



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