From 2be7ab21f64752eda4cc6558bd9116d5d1a58474 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 20 Aug 2002 19:23:15 +0000 Subject: Don't let the minimum recursive depth be negative. (get_folders): Pass 2002-08-20 Jeffrey Stedfast * providers/imap/camel-imap-store.c (get_folders): Don't let the minimum recursive depth be negative. (get_folders): Pass flags & CAMEL_FOLDER_INFO_SUBSCRIBED as the `lsub' argument to get_folders_online() otherwise we'll end up doing a LIST when we really wanted to do an LSUB. svn path=/trunk/; revision=17819 --- camel/ChangeLog | 6 ++++++ camel/providers/imap/camel-imap-store.c | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index 099c1d8ef4..040b2ab638 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,5 +1,11 @@ 2002-08-20 Jeffrey Stedfast + * providers/imap/camel-imap-store.c (get_folders): Don't let the + minimum recursive depth be negative. + (get_folders): Pass flags & CAMEL_FOLDER_INFO_SUBSCRIBED as the + `lsub' argument to get_folders_online() otherwise we'll end up + doing a LIST when we really wanted to do an LSUB. + * camel-session.c: Set CAMEL_URL_NEED_PATH for the vFolder provider. diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index 24f46f0d09..f54b129e27 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -2129,8 +2129,8 @@ get_folders(CamelStore *store, const char *top, guint32 flags, CamelException *e if (imap_max_depth == 0) { name = getenv("CAMEL_IMAP_MAX_DEPTH"); if (name) { - imap_max_depth = atoi(name); - imap_max_depth = MIN(imap_max_depth, 2); + imap_max_depth = atoi (name); + imap_max_depth = MIN (MAX (imap_max_depth, 0), 2); } else imap_max_depth = 10; } @@ -2150,16 +2150,16 @@ get_folders(CamelStore *store, const char *top, guint32 flags, CamelException *e folders_out = g_ptr_array_new(); folders = g_ptr_array_new(); - + /* first get working list of names */ - get_folders_online (imap_store, name[0]?name:"%", folders, FALSE, ex); + get_folders_online (imap_store, name[0]?name:"%", folders, flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED, ex); for (i=0; ilen && !haveinbox; i++) { fi = folders->pdata[i]; haveinbox = (strcasecmp(fi->full_name, "INBOX")) == 0; } if (!haveinbox && top == imap_store->namespace) - get_folders_online(imap_store, "INBOX", folders, FALSE, ex); + get_folders_online(imap_store, "INBOX", folders, flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED, ex); for (i=0; ilen; i++) p = g_slist_prepend(p, folders->pdata[i]); @@ -2192,7 +2192,7 @@ get_folders(CamelStore *store, const char *top, guint32 flags, CamelException *e char *n; n = imap_concat(imap_store, fi->full_name, "%"); - get_folders_online(imap_store, n, folders, FALSE, ex); + get_folders_online(imap_store, n, folders, flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED, ex); g_free(n); if (folders->len > 0) -- cgit