From d0edb931396f444394f70c61c6dd1031630b9970 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Wed, 2 May 2001 19:53:53 +0000 Subject: Clean this up a bit. Add a "tag_prefix" member. Move "useful_lsub" into * providers/imap/camel-imap-store.h: Clean this up a bit. Add a "tag_prefix" member. Move "useful_lsub" into capabilities. * providers/imap/camel-imap-store.c (camel_imap_store_init): Initialize the tag_prefix, based on a static variable. * providers/imap/camel-imap-command.c (camel_imap_command): Use the store's tag_prefix character rather than "A" at the start of the tag. Makes the verbose debug output easier to parse when connected to multiple IMAP servers. (Well, unless you're connected to more than 26 servers...) svn path=/trunk/; revision=9649 --- camel/providers/imap/camel-imap-store.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'camel/providers/imap/camel-imap-store.c') diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index 8511b3e9f7..42c2f12cde 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -54,12 +54,11 @@ #include "camel-imap-private.h" #include "camel-private.h" -#define d(x) x - /* Specified in RFC 2060 */ #define IMAP_PORT 143 static CamelRemoteStoreClass *remote_store_class = NULL; +static char imap_tag_prefix = 'A'; static void construct (CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, @@ -169,10 +168,13 @@ camel_imap_store_init (gpointer object, gpointer klass) imap_store->dir_sep = '\0'; imap_store->current_folder = NULL; - imap_store->connected = FALSE; imap_store->subscribed_folders = NULL; + imap_store->tag_prefix = imap_tag_prefix++; + if (imap_tag_prefix > 'Z') + imap_tag_prefix = 'A'; + imap_store->priv = g_malloc0 (sizeof (*imap_store->priv)); #ifdef ENABLE_THREADS imap_store->priv->command_lock = e_mutex_new(E_MUTEX_REC); @@ -653,7 +655,7 @@ imap_store_setup_online (CamelImapStore *store, CamelException *ex) if (!imap_parse_list_response (result, &flags, NULL, &name)) continue; if (flags & (IMAP_LIST_FLAG_MARKED | IMAP_LIST_FLAG_UNMARKED)) - store->useful_lsub = TRUE; + store->capabilities |= IMAP_CAPABILITY_useful_lsub; if (flags & IMAP_LIST_FLAG_NOSELECT) { g_free (name); continue; @@ -1161,7 +1163,8 @@ get_folder_info (CamelStore *store, const char *top, gboolean fast, * use get_subscribed_folders_by_hand. In all other * cases, use a single LIST or LSUB command. */ - if (subscribed_only && !imap_store->useful_lsub && + if (subscribed_only && + !(imap_store->capabilities & IMAP_CAPABILITY_useful_lsub) && (imap_store->parameters & IMAP_PARAM_CHECK_ALL)) { get_subscribed_folders_by_hand (imap_store, name, folders, ex); -- cgit v1.2.3