aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2002-10-18 11:32:42 +0800
committerMichael Zucci <zucchi@src.gnome.org>2002-10-18 11:32:42 +0800
commit1f92328c4b5c74022215796c64c286ae95c6fd7a (patch)
tree933706e7bb53672294aba15bb0b7ac1f2fe0326e /camel
parent50e16acfc84ea193c58997dc128c72cfbb5b15e9 (diff)
downloadgsoc2013-evolution-1f92328c4b5c74022215796c64c286ae95c6fd7a.tar.gz
gsoc2013-evolution-1f92328c4b5c74022215796c64c286ae95c6fd7a.tar.zst
gsoc2013-evolution-1f92328c4b5c74022215796c64c286ae95c6fd7a.zip
Do the filtering ourselves. This is so a problem like a missing uid (which
2002-10-03 Not Zed <NotZed@Ximian.com> * 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
Diffstat (limited to 'camel')
-rw-r--r--camel/camel-folder.c44
1 files changed, 41 insertions, 3 deletions
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 && i<m->recents->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