aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2000-08-08 04:32:27 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-08-08 04:32:27 +0800
commit35bb85fdf67039394e1dc20ac7d09fdaaa805c54 (patch)
treea7424bde6d1a63b35c2c5d227dc953594dc3d289 /camel/providers
parent03baf85a6a3d42573bee99adcad5ca919cd63659 (diff)
downloadgsoc2013-evolution-35bb85fdf67039394e1dc20ac7d09fdaaa805c54.tar.gz
gsoc2013-evolution-35bb85fdf67039394e1dc20ac7d09fdaaa805c54.tar.zst
gsoc2013-evolution-35bb85fdf67039394e1dc20ac7d09fdaaa805c54.zip
If we are trying to get a subfolder listing of the root folder, always
2000-08-07 Jeffrey Stedfast <fejj@helixcode.com> * providers/imap/camel-imap-folder.c (imap_get_subfolder_names_internal): If we are trying to get a subfolder listing of the root folder, always make sure INBOX is there... * providers/imap/camel-imap-utils.c (imap_parse_list_response): Check for NIL as a directory separator. svn path=/trunk/; revision=4582
Diffstat (limited to 'camel/providers')
-rw-r--r--camel/providers/imap/camel-imap-folder.c23
-rw-r--r--camel/providers/imap/camel-imap-utils.c10
2 files changed, 23 insertions, 10 deletions
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index ca99da671c..82d133b0ab 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -734,6 +734,7 @@ imap_get_subfolder_names_internal (CamelFolder *folder, CamelException *ex)
CamelStore *store = CAMEL_STORE (folder->parent_store);
CamelURL *url = CAMEL_SERVICE (store)->url;
GPtrArray *listing;
+ gboolean found_inbox = FALSE;
gint status;
gchar *result, *namespace, *dir_sep;
@@ -776,17 +777,17 @@ imap_get_subfolder_names_internal (CamelFolder *folder, CamelException *ex)
char *ptr = result;
while (ptr && *ptr == '*') {
- gchar *flags, *sep, *folder, *buf, *end;
+ gchar *flags, *sep, *dir, *buf, *end;
for (end = ptr; *end && *end != '\n'; end++);
buf = g_strndup (ptr, (gint)(end - ptr));
ptr = end;
- if (!imap_parse_list_response (buf, namespace, &flags, &sep, &folder)) {
+ if (!imap_parse_list_response (buf, namespace, &flags, &sep, &dir)) {
g_free (buf);
g_free (flags);
g_free (sep);
- g_free (folder);
+ g_free (dir);
if (*ptr == '\n')
ptr++;
@@ -797,9 +798,12 @@ imap_get_subfolder_names_internal (CamelFolder *folder, CamelException *ex)
g_free (buf);
g_free (flags);
- d(fprintf (stderr, "adding folder: %s\n", folder));
-
- g_ptr_array_add (listing, folder);
+ if (*dir) {
+ d(fprintf (stderr, "adding folder: %s\n", dir));
+ if (!strcmp (dir, "INBOX"))
+ found_inbox = TRUE;
+ g_ptr_array_add (listing, dir);
+ }
g_free (sep);
@@ -807,9 +811,14 @@ imap_get_subfolder_names_internal (CamelFolder *folder, CamelException *ex)
ptr++;
}
}
+
+ if (!strcmp (folder->name, namespace) && !found_inbox) {
+ g_ptr_array_add (listing, "INBOX");
+ }
+
g_free (result);
g_free (namespace);
-
+
imap_folder->lsub = listing;
return listing;
diff --git a/camel/providers/imap/camel-imap-utils.c b/camel/providers/imap/camel-imap-utils.c
index f1c4c17782..3378758a69 100644
--- a/camel/providers/imap/camel-imap-utils.c
+++ b/camel/providers/imap/camel-imap-utils.c
@@ -94,9 +94,13 @@ imap_parse_list_response (char *buf, char *namespace, char **flags, char **sep,
/* get the directory separator */
word = imap_next_word (ep);
if (*word) {
- for (ep = word; *ep && *ep != ' '; ep++);
- *sep = g_strndup (word, (gint)(ep - word));
- string_unquote (*sep);
+ if (!strncmp (word, "NIL", 3)) {
+ *sep = NULL;
+ } else {
+ for (ep = word; *ep && *ep != ' '; ep++);
+ *sep = g_strndup (word, (gint)(ep - word));
+ string_unquote (*sep);
+ }
} else {
return FALSE;
}