diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-09-14 09:44:18 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-09-14 09:44:18 +0800 |
commit | 0676d2890e8def5d8876da6784df4e673b0703a1 (patch) | |
tree | e8eefa6b292df016f38d82f2a6f96ad1af966cdf /camel/camel-filter-driver.c | |
parent | c109102df34ceb19c72fbc8c410c9ec158c6b3a5 (diff) | |
download | gsoc2013-evolution-0676d2890e8def5d8876da6784df4e673b0703a1.tar.gz gsoc2013-evolution-0676d2890e8def5d8876da6784df4e673b0703a1.tar.zst gsoc2013-evolution-0676d2890e8def5d8876da6784df4e673b0703a1.zip |
Don't reuse the exception if it has already been set.
2001-09-13 Jeffrey Stedfast <fejj@ximian.com>
* camel-filter-driver.c (camel_filter_driver_filter_folder): Don't
reuse the exception if it has already been set.
(camel_filter_driver_filter_message): Same here. Also use the new
return value from camel_filter_search_match().
* camel-filter-search.c (camel_filter_search_match): Return an
integer (matched, no-match, or error).
svn path=/trunk/; revision=12819
Diffstat (limited to 'camel/camel-filter-driver.c')
-rw-r--r-- | camel/camel-filter-driver.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/camel/camel-filter-driver.c b/camel/camel-filter-driver.c index 31bc40f4b6..e7a430cdff 100644 --- a/camel/camel-filter-driver.c +++ b/camel/camel-filter-driver.c @@ -812,7 +812,7 @@ camel_filter_driver_filter_folder (CamelFilterDriver *driver, CamelFolder *folde if (p->defaultfolder) { report_status (driver, CAMEL_FILTER_STATUS_PROGRESS, 100, _("Syncing folder")); - camel_folder_sync (p->defaultfolder, FALSE, ex); + camel_folder_sync (p->defaultfolder, FALSE, camel_exception_is_set (ex) ? NULL : ex); } if (i == uids->len) @@ -853,10 +853,11 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage CamelException *ex) { struct _CamelFilterDriverPrivate *p = _PRIVATE (driver); - ESExpResult *r; struct _filter_rule *node; gboolean freeinfo = FALSE; gboolean filtered = FALSE; + ESExpResult *r; + int result; if (info == NULL) { struct _header_raw *h = CAMEL_MIME_PART (message)->headers; @@ -881,12 +882,15 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage camel_mime_message_set_source (message, original_source_url); node = (struct _filter_rule *)p->rules.head; - while (node->next) { + result = CAMEL_SEARCH_NOMATCH; + while (node->next && result != CAMEL_SEARCH_ERROR) { d(fprintf (stderr, "applying rule %s\naction %s\n", node->match, node->action)); - if (camel_filter_search_match (p->message, p->info, - original_source_url ? original_source_url : source_url, - node->match, p->ex)) { + result = camel_filter_search_match (p->message, p->info, + original_source_url ? original_source_url : source_url, + node->match, p->ex); + + if (result == CAMEL_SEARCH_MATCHED) { filtered = TRUE; camel_filter_driver_log (driver, FILTER_LOG_START, node->name); @@ -925,10 +929,13 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage uids = g_ptr_array_new (); g_ptr_array_add (uids, (char *) p->uid); - camel_folder_copy_messages_to (p->source, uids, p->defaultfolder, p->ex); + camel_folder_copy_messages_to (p->source, uids, p->defaultfolder, + result == CAMEL_SEARCH_ERROR ? NULL : p->ex); g_ptr_array_free (uids, TRUE); - } else - camel_folder_append_message (p->defaultfolder, p->message, p->info, p->ex); + } else { + camel_folder_append_message (p->defaultfolder, p->message, p->info, + result == CAMEL_SEARCH_ERROR ? NULL : p->ex); + } } if (freeinfo) |