diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2010-06-24 23:10:35 +0100 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-06-28 13:45:25 +0100 |
commit | 5108c911d1227ed81356c77ae9cfa6e87e9f6ccb (patch) | |
tree | 5e0c557e73cfa95f2e959a5202483d063b312b99 | |
parent | d28c7d7c4c92ee7619af80f7498645e653d1c7f2 (diff) | |
download | evolution-data-server-5108c911d1227ed81356c77ae9cfa6e87e9f6ccb.tar.gz |
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.
(cherry picked from commit 900172c35ea875e7e0f5b79887b8535dddd0a0c0)
-rw-r--r-- | 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 75567732c..2493fa642 100644 --- a/camel/providers/imapx/camel-imapx-store.c +++ b/camel/providers/imapx/camel-imapx-store.c @@ -886,7 +886,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; @@ -894,10 +894,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; @@ -921,15 +931,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 */ @@ -937,9 +938,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); |