diff options
author | Dan Winship <danw@src.gnome.org> | 2001-05-03 03:53:53 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2001-05-03 03:53:53 +0800 |
commit | d0edb931396f444394f70c61c6dd1031630b9970 (patch) | |
tree | 34f81490a44241b78322777b742d061d481fad54 /camel/providers/imap/camel-imap-store.c | |
parent | fec8edd6818c7f7fd64ae305dbb75574e73a6581 (diff) | |
download | gsoc2013-evolution-d0edb931396f444394f70c61c6dd1031630b9970.tar gsoc2013-evolution-d0edb931396f444394f70c61c6dd1031630b9970.tar.gz gsoc2013-evolution-d0edb931396f444394f70c61c6dd1031630b9970.tar.bz2 gsoc2013-evolution-d0edb931396f444394f70c61c6dd1031630b9970.tar.lz gsoc2013-evolution-d0edb931396f444394f70c61c6dd1031630b9970.tar.xz gsoc2013-evolution-d0edb931396f444394f70c61c6dd1031630b9970.tar.zst gsoc2013-evolution-d0edb931396f444394f70c61c6dd1031630b9970.zip |
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
Diffstat (limited to 'camel/providers/imap/camel-imap-store.c')
-rw-r--r-- | camel/providers/imap/camel-imap-store.c | 13 |
1 files changed, 8 insertions, 5 deletions
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); |