aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-12-23 04:33:00 +0800
committerDan Winship <danw@src.gnome.org>2000-12-23 04:33:00 +0800
commit7706c0163b753b4f71b367786f0e20ba9bcd0896 (patch)
treece3112ec2ee638ec4891fa4d66f708391c16a693 /camel/providers/imap
parent4369c400fc801eef03a6fdda2b5256972f018246 (diff)
downloadgsoc2013-evolution-7706c0163b753b4f71b367786f0e20ba9bcd0896.tar
gsoc2013-evolution-7706c0163b753b4f71b367786f0e20ba9bcd0896.tar.gz
gsoc2013-evolution-7706c0163b753b4f71b367786f0e20ba9bcd0896.tar.bz2
gsoc2013-evolution-7706c0163b753b4f71b367786f0e20ba9bcd0896.tar.lz
gsoc2013-evolution-7706c0163b753b4f71b367786f0e20ba9bcd0896.tar.xz
gsoc2013-evolution-7706c0163b753b4f71b367786f0e20ba9bcd0896.tar.zst
gsoc2013-evolution-7706c0163b753b4f71b367786f0e20ba9bcd0896.zip
When getting the top-level folder list, include INBOX even if it's not
* providers/imap/camel-imap-store.c (get_folder_info): When getting the top-level folder list, include INBOX even if it's not subscribed. Don't show subscribed folders outside of the given namespace. Do a better job of pruning the namespace from the returned folder tree. svn path=/trunk/; revision=7131
Diffstat (limited to 'camel/providers/imap')
-rw-r--r--camel/providers/imap/camel-imap-store.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index 6a87aec3ad..e3bd61af27 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -615,7 +615,7 @@ get_folder_info (CamelStore *store, const char *top, gboolean fast,
name = top;
if (!name) {
- need_inbox = !subscribed_only;
+ need_inbox = TRUE;
if (url->path)
name = url->path + 1;
else
@@ -636,9 +636,7 @@ get_folder_info (CamelStore *store, const char *top, gboolean fast,
topfi->name = g_strdup (name);
}
- if (!top && subscribed_only)
- pattern = g_strdup (recursive ? "*" : "%");
- else if (*name)
+ if (*name)
pattern = g_strdup_printf ("%s%c%c", name, imap_store->dir_sep,
recursive ? '*' : '%');
else
@@ -721,14 +719,23 @@ get_folder_info (CamelStore *store, const char *top, gboolean fast,
camel_folder_info_build (folders, topfi, imap_store->dir_sep, TRUE);
g_ptr_array_free (folders, TRUE);
- /* Remove the top if it's the root of the store. */
- if (!top && !topfi->sibling && !topfi->url) {
- fi = topfi;
- topfi = topfi->child;
- fi->child = NULL;
- camel_folder_info_free (fi);
- for (fi = topfi; fi; fi = fi->sibling)
- fi->parent = NULL;
+ /* If this is the root of the store, prune off any namespace. */
+ if (!top && !topfi->sibling) {
+ int toplen = strlen (name), len;
+
+ while (!topfi->sibling) {
+ len = strlen (topfi->full_name);
+ if (len > toplen ||
+ strncmp (topfi->full_name, name, len) != 0)
+ break;
+
+ fi = topfi;
+ topfi = topfi->child;
+ fi->child = NULL;
+ camel_folder_info_free (fi);
+ for (fi = topfi; fi; fi = fi->sibling)
+ fi->parent = NULL;
+ }
}
return topfi;