From d6443cd2ca8b523e941d9c184b34a8bcccdc7cc1 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Wed, 3 Mar 2004 06:36:44 +0000 Subject: fun dun diddley un fun. Since we're writing a const buffer, we need to 2004-03-03 Not Zed * camel-stream-filter.c (do_write, do_write): fun dun diddley un fun. Since we're writing a const buffer, we need to copy it first. See #54937. 2004-02-27 Not Zed ** See bug #54755. * camel-vtrash-folder.c (vtrash_append_message) (vtrash_transfer_messages_to): error/fail out if the user tries to copy messages to the trash. (vtrash_transfer_messages_to): use the destination bit not the source bit for moving messages to a vtrash folder. * camel-gpg-context.c (gpg_ctx_parse_status): ignore NODATA response, otherwise we abort in a meaningless way. See #52939. * providers/imap/camel-imap-utils.c: use g_ascii_str[n]casecmp everywhere. * providers/imap/camel-imap-utils.c (imap_body_decode): fix the sense of the nil check for the subtype of a mutlipart. See #53355. 2004-02-26 Not Zed * camel-session.c (camel_session_check_junk_for_imap) (camel_session_set_check_junk_for_imap): removed. * providers/imap/camel-imap-provider.c: Add filter_junk and filter_junk_inbox options to the receive option page. * providers/imap/camel-imap-store.c (imap_setv, imap_getv): handle FILTER_JUNK and FILTER_JUNK_INBOX parameters. (imap_setv): conver to switch rather than if statement. (construct): handle url args for filter_junk and filter_junk_inbox. * providers/imap/camel-imap-folder.c (camel_imap_folder_new): Set the folder's flags based on the stores junk settings. (imap_update_summary): remove the test for session_check_junk_for_imap, its handled per-store now. * camel-folder.c (folder_changed): only check for FILTER_RECENT or FILTER_JUNK to see if we need to do filtering. * camel-folder.h (CAMEL_FOLDER_FILTER_JUNK): renamed from CAMEL_FOLDER_SUPRESS_JUNK_TEST (and obviously inverted logic). svn path=/trunk/; revision=24942 --- camel/providers/imap/camel-imap-store.c | 39 ++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 10 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 335b98b4a7..b40c5577be 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -322,6 +322,10 @@ construct (CamelService *service, CamelSession *session, imap_store->parameters |= IMAP_PARAM_FILTER_INBOX; store->flags |= CAMEL_STORE_FILTER_INBOX; } + if (camel_url_get_param (url, "filter_junk")) + imap_store->parameters |= IMAP_PARAM_FILTER_JUNK; + if (camel_url_get_param (url, "filter_junk_inbox")) + imap_store->parameters |= IMAP_PARAM_FILTER_JUNK_INBOX; /* setup/load the store summary */ tmp = alloca(strlen(imap_store->storage_path)+32); @@ -368,15 +372,17 @@ imap_setv (CamelObject *object, CamelException *ex, CamelArgV *args) if ((tag & CAMEL_ARG_TAG) <= CAMEL_IMAP_STORE_ARG_FIRST || (tag & CAMEL_ARG_TAG) >= CAMEL_IMAP_STORE_ARG_FIRST + 100) continue; - - if (tag == CAMEL_IMAP_STORE_NAMESPACE) { + + switch (tag) { + case CAMEL_IMAP_STORE_NAMESPACE: if (strcmp (store->namespace, args->argv[i].ca_str) != 0) { g_free (store->namespace); store->namespace = g_strdup (args->argv[i].ca_str); /* the current imap code will need to do a reconnect for this to take effect */ /*reconnect = TRUE;*/ } - } else if (tag == CAMEL_IMAP_STORE_OVERRIDE_NAMESPACE) { + break; + case CAMEL_IMAP_STORE_OVERRIDE_NAMESPACE: flags = args->argv[i].ca_int ? IMAP_PARAM_OVERRIDE_NAMESPACE : 0; flags |= (store->parameters & ~IMAP_PARAM_OVERRIDE_NAMESPACE); @@ -385,17 +391,28 @@ imap_setv (CamelObject *object, CamelException *ex, CamelArgV *args) /* the current imap code will need to do a reconnect for this to take effect */ /*reconnect = TRUE;*/ } - } else if (tag == CAMEL_IMAP_STORE_CHECK_ALL) { + break; + case CAMEL_IMAP_STORE_CHECK_ALL: flags = args->argv[i].ca_int ? IMAP_PARAM_CHECK_ALL : 0; flags |= (store->parameters & ~IMAP_PARAM_CHECK_ALL); store->parameters = flags; /* no need to reconnect for this option to take effect... */ - } else if (tag == CAMEL_IMAP_STORE_FILTER_INBOX) { + break; + case CAMEL_IMAP_STORE_FILTER_INBOX: flags = args->argv[i].ca_int ? IMAP_PARAM_FILTER_INBOX : 0; flags |= (store->parameters & ~IMAP_PARAM_FILTER_INBOX); store->parameters = flags; /* no need to reconnect for this option to take effect... */ - } else { + break; + case CAMEL_IMAP_STORE_FILTER_JUNK: + flags = args->argv[i].ca_int ? IMAP_PARAM_FILTER_JUNK : 0; + store->parameters = flags | (store->parameters & ~IMAP_PARAM_FILTER_JUNK); + break; + case CAMEL_IMAP_STORE_FILTER_JUNK_INBOX: + flags = args->argv[i].ca_int ? IMAP_PARAM_FILTER_JUNK_INBOX : 0; + store->parameters = flags | (store->parameters & ~IMAP_PARAM_FILTER_JUNK_INBOX); + break; + default: /* error?? */ continue; } @@ -428,21 +445,23 @@ imap_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args) switch (tag) { case CAMEL_IMAP_STORE_NAMESPACE: - /* get the username */ *args->argv[i].ca_str = store->namespace; break; case CAMEL_IMAP_STORE_OVERRIDE_NAMESPACE: - /* get the auth mechanism */ *args->argv[i].ca_int = store->parameters & IMAP_PARAM_OVERRIDE_NAMESPACE ? TRUE : FALSE; break; case CAMEL_IMAP_STORE_CHECK_ALL: - /* get the hostname */ *args->argv[i].ca_int = store->parameters & IMAP_PARAM_CHECK_ALL ? TRUE : FALSE; break; case CAMEL_IMAP_STORE_FILTER_INBOX: - /* get the port */ *args->argv[i].ca_int = store->parameters & IMAP_PARAM_FILTER_INBOX ? TRUE : FALSE; break; + case CAMEL_IMAP_STORE_FILTER_JUNK: + *args->argv[i].ca_int = store->parameters & IMAP_PARAM_FILTER_JUNK ? TRUE : FALSE; + break; + case CAMEL_IMAP_STORE_FILTER_JUNK_INBOX: + *args->argv[i].ca_int = store->parameters & IMAP_PARAM_FILTER_JUNK_INBOX ? TRUE : FALSE; + break; default: /* error? */ break; -- cgit