diff options
author | Dan Winship <danw@src.gnome.org> | 2000-12-23 04:33:00 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2000-12-23 04:33:00 +0800 |
commit | 7706c0163b753b4f71b367786f0e20ba9bcd0896 (patch) | |
tree | ce3112ec2ee638ec4891fa4d66f708391c16a693 | |
parent | 4369c400fc801eef03a6fdda2b5256972f018246 (diff) | |
download | gsoc2013-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
-rw-r--r-- | camel/ChangeLog | 8 | ||||
-rw-r--r-- | camel/providers/imap/camel-imap-store.c | 31 |
2 files changed, 27 insertions, 12 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index a13109fe80..3a2563fefc 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,11 @@ +2000-12-22 Dan Winship <danw@helixcode.com> + + * 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. + 2000-12-21 Dan Winship <danw@helixcode.com> * providers/imap/camel-imap-search.c: New CamelFolderSearch 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; |