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/providers/imap/camel-imap-folder.c | 38 ++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 7 deletions(-) (limited to 'camel/providers') 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 v1.2.3