From 0b8af6dc0a87c119bf91b7aa62157d627cf573d0 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 27 Mar 2001 05:23:12 +0000 Subject: Kludge, copied+modified from mail_config_folder_to_cachename to deal with * mail-ops.c (uid_cachename_hack): Kludge, copied+modified from mail_config_folder_to_cachename to deal with the different behavior of the URL code now. Will go away when the keep-on-server code moves. (get_folderinfo_get): Only pass "subscribed_only" to camel_store_get_folder_info if the store supports subscriptions... svn path=/trunk/; revision=8970 --- mail/mail-ops.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/mail/mail-ops.c b/mail/mail-ops.c index e2a4bc8db0..7b1e8adcf4 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -28,6 +28,7 @@ #include #include +#include #include #include #include "mail.h" @@ -249,6 +250,25 @@ void mail_filter_on_demand(CamelFolder *folder, GPtrArray *uids) /* ********************************************************************** */ +/* Temporary workaround for various issues. Gone before 0.11 */ +static char * +uid_cachename_hack (CamelStore *store) +{ + CamelURL *url = CAMEL_SERVICE (store)->url; + char *encoded_url, *filename; + + encoded_url = g_strdup_printf ("pop://%s%s%s@%s/", url->user, + url->authmech ? ";auth=" : "", + url->authmech ? url->authmech : "", + url->host); + e_filename_make_safe (encoded_url); + + filename = g_strdup_printf ("%s/config/cache-%s", evolution_dir, encoded_url); + g_free (encoded_url); + + return filename; +} + static void fetch_mail_fetch(struct _mail_msg *mm) { @@ -289,7 +309,7 @@ fetch_mail_fetch(struct _mail_msg *mm) CamelUIDCache *cache = NULL; char *cachename; - cachename = mail_config_folder_to_cachename (folder, "cache-"); + cachename = uid_cachename_hack (folder->parent_store); cache = camel_uid_cache_new (cachename); g_free (cachename); @@ -973,7 +993,7 @@ static void get_folderinfo_get(struct _mail_msg *mm) struct _get_folderinfo_msg *m = (struct _get_folderinfo_msg *)mm; camel_operation_register(mm->cancel); - m->info = camel_store_get_folder_info(m->store, NULL, FALSE, TRUE, TRUE, &mm->ex); + m->info = camel_store_get_folder_info(m->store, NULL, FALSE, TRUE, camel_store_supports_subscriptions(m->store), &mm->ex); if (m->info && m->info->url) add_vtrash_info (m->info); camel_operation_unregister(mm->cancel); -- cgit v1.2.3