From 1f92328c4b5c74022215796c64c286ae95c6fd7a Mon Sep 17 00:00:00 2001 From: Not Zed Date: Fri, 18 Oct 2002 03:32:42 +0000 Subject: Do the filtering ourselves. This is so a problem like a missing uid (which 2002-10-03 Not Zed * camel-folder.c (filter_filter): Do the filtering ourselves. This is so a problem like a missing uid (which can happen legitemitely) doesn't prematurely abort filtering. Stop on all other errors. See #31667. svn path=/trunk/; revision=18392 --- camel/camel-folder.c | 44 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) (limited to 'camel') diff --git a/camel/camel-folder.c b/camel/camel-folder.c index 8b121d5d75..5da51d9385 100644 --- a/camel/camel-folder.c +++ b/camel/camel-folder.c @@ -1560,9 +1560,47 @@ static void filter_filter(CamelSession *session, CamelSessionThreadMsg *msg) { struct _folder_filter_msg *m = (struct _folder_filter_msg *)msg; - - camel_filter_driver_filter_folder(m->driver, m->folder, NULL, m->recents, FALSE, &m->ex); - camel_filter_driver_flush (m->driver, &m->ex); + CamelMessageInfo *info; + int i, status = 0; + CamelURL *uri; + char *source_url; + CamelException ex; + + /* FIXME: progress? (old code didn't have useful progress either) */ + + source_url = camel_service_get_url((CamelService *)m->folder->parent_store); + uri = camel_url_new(source_url, NULL); + g_free(source_url); + if (m->folder->full_name && m->folder->full_name[0] != '/') { + char *tmp = alloca(strlen(m->folder->full_name)+2); + + sprintf(tmp, "/%s", m->folder->full_name); + camel_url_set_path(uri, tmp); + } else + camel_url_set_path(uri, m->folder->full_name); + source_url = camel_url_to_string(uri, CAMEL_URL_HIDE_ALL); + camel_url_free(uri); + + for (i=0;status == 0 && irecents->len;i++) { + char *uid = m->recents->pdata[i]; + + info = camel_folder_get_message_info(m->folder, uid); + if (info == NULL) { + g_warning("uid %s vanished from folder: %s", uid, source_url); + continue; + } + + status = camel_filter_driver_filter_message(m->driver, NULL, info, uid, m->folder, source_url, source_url, &m->ex); + + camel_folder_free_message_info(m->folder, info); + } + + camel_exception_init(&ex); + camel_filter_driver_flush(m->driver, &ex); + if (!camel_exception_is_set(&m->ex)) + camel_exception_xfer(&m->ex, &ex); + + g_free(source_url); } static void -- cgit v1.2.3