From f75bb1e1c94412cd0d190ac5409a383a76339cb4 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 25 Aug 2000 17:17:08 +0000 Subject: If the url path is "/" and the folder path is "/", just LIST "" "*" (this 2000-08-25 Jeffrey Stedfast * providers/imap/camel-imap-folder.c (imap_get_subfolder_names_internal): If the url path is "/" and the folder path is "/", just LIST "" "*" (this should fix some cyrus imapd problems) svn path=/trunk/; revision=5036 --- camel/ChangeLog | 7 ++++++ camel/providers/imap/camel-imap-folder.c | 38 ++++++++++++++++++++++++++------ 2 files changed, 38 insertions(+), 7 deletions(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index cc7ea92a4b..d1aabc69c0 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,10 @@ +2000-08-25 Jeffrey Stedfast + + * providers/imap/camel-imap-folder.c + (imap_get_subfolder_names_internal): If the url path is "/" and + the folder path is "/", just LIST "" "*" (this should fix some + cyrus imapd problems) + 2000-08-24 Lauris Kaplinski * camel-folder-summary.c (summary_build_content_info): diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index 5730002af4..72c04d972e 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -158,13 +158,14 @@ camel_imap_folder_get_type (void) static CamelType camel_imap_folder_type = CAMEL_INVALID_TYPE; if (camel_imap_folder_type == CAMEL_INVALID_TYPE) { - camel_imap_folder_type = camel_type_register (CAMEL_FOLDER_TYPE, "CamelImapFolder", - sizeof (CamelImapFolder), - sizeof (CamelImapFolderClass), - (CamelObjectClassInitFunc) camel_imap_folder_class_init, - NULL, - (CamelObjectInitFunc) camel_imap_folder_init, - (CamelObjectFinalizeFunc) imap_finalize); + camel_imap_folder_type = + camel_type_register (CAMEL_FOLDER_TYPE, "CamelImapFolder", + sizeof (CamelImapFolder), + sizeof (CamelImapFolderClass), + (CamelObjectClassInitFunc) camel_imap_folder_class_init, + NULL, + (CamelObjectInitFunc) camel_imap_folder_init, + (CamelObjectFinalizeFunc) imap_finalize); } return camel_imap_folder_type; @@ -744,6 +745,8 @@ imap_get_subfolder_names_internal (CamelFolder *folder, CamelException *ex) dir_sep = CAMEL_IMAP_STORE (folder->parent_store)->dir_sep; +#if 0 + /* this is the old code, the new code hasn't been tested */ if (url && url->path) { if (!strcmp (folder->full_name, url->path + 1)) namespace = g_strdup (url->path + 1); @@ -754,6 +757,27 @@ imap_get_subfolder_names_internal (CamelFolder *folder, CamelException *ex) } else { namespace = g_strdup (folder->full_name); } +#endif + + if (url && url->path) { + char *path = url->path + 1; + + if (*path) { + if (!strcmp (folder->full_name, path)) + namespace = g_strdup (path); + else if (!strcmp (folder->full_name, "INBOX")) + namespace = g_strdup (path); /* FIXME: erm...not sure */ + else + namespace = g_strdup_printf ("%s%s%s", path, dir_sep, folder->full_name); + } else { + if (!strcmp (folder->full_name, "/")) + namespace = g_strdup (""); + else + namespace = g_strdup (folder->full_name); + } + } else { + namespace = g_strdup (folder->full_name); + } status = camel_imap_command_extended (CAMEL_IMAP_STORE (folder->parent_store), NULL, &result, "LIST \"\" \"%s%s*\"", namespace, -- cgit