From d4656431e9de8e6e3ab526d71323f0d0543c587e Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Mon, 30 Oct 2000 03:24:15 +0000 Subject: Improved IMAP namespace handling: leave the namespace in the folder names rather than constantly prepending it and stripping it off. Also some subscription fixes. * camel-store.c (camel_folder_info_build): Fix for the case where @top isn't in @folders. * providers/imap/camel-imap-folder.c (camel_imap_folder_new): Add a "short_name" argument rather than figuring it out ourselves. (imap_get_full_name): Implementation of CamelFolder::get_full_name that strips off namespace so the user doesn't have to see it. (imap_append_message, imap_copy_message_to, imap_move_message_to): Use folder->full_name rather than calling camel_imap_store_get_folder_path. * providers/imap/camel-imap-utils.c (imap_parse_list_response): Update this: make @flags a bitmask and @sep a char rather than a string. Make all of the out arguments optional. Handle literals in the server response. * providers/imap/camel-imap-store.c (imap_connect): Do a better job of getting the correct dir_sep for the namespace we're using. Construct a base_url here that will be used by get_folder_info. (camel_imap_store_folder_path): Removed (imap_folder_exists): Add an argument to return the short name of the folder (parsed out of the LIST response). Update for imap_parse_list_response change. (get_folder): Update for the various other changes. (get_folder_info): Update for the various other changes. Be more consistent about the returned layout: put everything underneath the "namespace" directory, including INBOX, even if it doesn't belong there. Don't destroy the list of subscribed folders until we've actually gotten the new list. (folder_subscribed, subscribe_folder, unsubscribe_folder): Use folder_name directly rather than camel_imap_store_folder_Path. * providers/imap/camel-imap-command.c (camel_imap_command): Update for folder name changes. svn path=/trunk/; revision=6256 --- camel/providers/imap/camel-imap-utils.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'camel/providers/imap/camel-imap-utils.h') diff --git a/camel/providers/imap/camel-imap-utils.h b/camel/providers/imap/camel-imap-utils.h index 28dea3cc9f..d0cc05832d 100644 --- a/camel/providers/imap/camel-imap-utils.h +++ b/camel/providers/imap/camel-imap-utils.h @@ -32,7 +32,11 @@ extern "C" { char *imap_next_word (const char *buf); -gboolean imap_parse_list_response (const char *buf, const char *namespace, char **flags, char **sep, char **folder); +#define IMAP_LIST_FLAG_NOINFERIORS (1 << 0) +#define IMAP_LIST_FLAG_NOSELECT (1 << 1) +#define IMAP_LIST_FLAG_MARKED (1 << 2) +#define IMAP_LIST_FLAG_UNMARKED (1 << 3) +gboolean imap_parse_list_response (const char *buf, int *flags, char *sep, char **folder); char *imap_translate_sexp (const char *expression); @@ -40,6 +44,7 @@ char *imap_create_flag_list (guint32 flags); guint32 imap_parse_flag_list (const char *flag_list); char *imap_parse_nstring (char **str_p, int *len); +char *imap_parse_astring (char **str_p, int *len); #ifdef __cplusplus } -- cgit v1.2.3