[evolution-data-server] Don't show subscribed but non-existent folders.



commit 900172c35ea875e7e0f5b79887b8535dddd0a0c0
Author: David Woodhouse <David Woodhouse intel com>
Date:   Thu Jun 24 23:10:35 2010 +0100

    Don't show subscribed but non-existent folders.
    
    The RFCs are clear that it's OK to have non-existent folders in the
    subscribed list. Don't treat them as if they were real folders -- just
    use their existence in the LSUB response to set the SUBSCRIBED flag if they
    were already returned by the LIST response.

 camel/providers/imapx/camel-imapx-store.c |   26 ++++++++++++--------------
 1 files changed, 12 insertions(+), 14 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-store.c b/camel/providers/imapx/camel-imapx-store.c
index d04518c..b03fdc6 100644
--- a/camel/providers/imapx/camel-imapx-store.c
+++ b/camel/providers/imapx/camel-imapx-store.c
@@ -923,7 +923,7 @@ get_folder_info_offline (CamelStore *store, const gchar *top,
 }
 
 static void
-add_folders_to_summary (CamelIMAPXStore *istore, GPtrArray *folders, GHashTable *table, gboolean subcribed)
+add_folders_to_summary (CamelIMAPXStore *istore, GPtrArray *folders, GHashTable *table, gboolean subscribed)
 {
 	gint i = 0;
 
@@ -931,10 +931,20 @@ add_folders_to_summary (CamelIMAPXStore *istore, GPtrArray *folders, GHashTable
 		struct _list_info *li = folders->pdata[i];
 		CamelIMAPXStoreInfo *si;
 		guint32 new_flags;
-		CamelFolderInfo *fi, *hfi;
+		CamelFolderInfo *fi, *sfi;
 		gchar *path;
 		CamelURL *url;
 
+		if (subscribed) {
+			path = camel_imapx_store_summary_path_to_full (istore->summary, li->name, li->separator);
+			sfi = g_hash_table_lookup (table, path);
+			if (sfi)
+				sfi->flags |= CAMEL_STORE_INFO_FOLDER_SUBSCRIBED;
+
+			g_free(path);
+			continue;
+		}
+
 		si = camel_imapx_store_summary_add_from_full (istore->summary, li->name, li->separator);
 		if (!si)
 			continue;
@@ -958,15 +968,6 @@ add_folders_to_summary (CamelIMAPXStore *istore, GPtrArray *folders, GHashTable
 		} else
 			fi->name = g_strdup(camel_store_info_name(istore->summary, si));
 
-		hfi = g_hash_table_lookup (table, fi->full_name);
-		if (hfi) {
-			if (subcribed)
-				hfi->flags |= CAMEL_STORE_INFO_FOLDER_SUBSCRIBED;
-
-			camel_folder_info_free (fi);
-			continue;
-		}
-
 		/* HACK: some servers report noinferiors for all folders (uw-imapd)
 		   We just translate this into nochildren, and let the imap layer enforce
 		   it.  See create folder */
@@ -974,9 +975,6 @@ add_folders_to_summary (CamelIMAPXStore *istore, GPtrArray *folders, GHashTable
 			li->flags = (li->flags & ~CAMEL_FOLDER_NOINFERIORS) | CAMEL_FOLDER_NOCHILDREN;
 		fi->flags = li->flags;
 
-		if (subcribed)
-			fi->flags |= CAMEL_STORE_INFO_FOLDER_SUBSCRIBED;
-
 		url = camel_url_new (istore->base_url, NULL);
 		path = alloca(strlen(fi->full_name)+2);
 		sprintf(path, "/%s", fi->full_name);



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