aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--filter/ChangeLog3
-rw-r--r--filter/filter-driver.c10
2 files changed, 10 insertions, 3 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog
index c7778c5ca6..19609707bb 100644
--- a/filter/ChangeLog
+++ b/filter/ChangeLog
@@ -4,6 +4,9 @@
default folder and the message hasn't been deleted then... should
be: If there is a default folder and the message hasn't been
copied to another folder...
+ (filter_driver_filter_message): Make it so that the FILTER_LOG_END
+ is only called if filtered were applied to the message so we don't
+ get huge gaps of whitespace in the log file.
2000-11-10 Christopher James Lahey <clahey@helixcode.com>
diff --git a/filter/filter-driver.c b/filter/filter-driver.c
index 666afa0b8e..48e95f9877 100644
--- a/filter/filter-driver.c
+++ b/filter/filter-driver.c
@@ -723,7 +723,8 @@ filter_driver_filter_message (FilterDriver *driver, CamelMimeMessage *message, C
ESExpResult *r;
GString *fsearch, *faction;
FilterFilter *rule;
- int freeinfo = FALSE;
+ gboolean freeinfo = FALSE;
+ gboolean filtered = FALSE;
if (info == NULL) {
struct _header_raw *h = CAMEL_MIME_PART (message)->headers;
@@ -766,6 +767,7 @@ filter_driver_filter_message (FilterDriver *driver, CamelMimeMessage *message, C
mail_tool_camel_lock_down ();
if (matched) {
+ filtered = TRUE;
filter_driver_log (driver, FILTER_LOG_START, FILTER_RULE (rule)->name);
#ifndef NO_WARNINGS
#warning "Must check expression parsed and executed properly?"
@@ -785,6 +787,7 @@ filter_driver_filter_message (FilterDriver *driver, CamelMimeMessage *message, C
if (p->defaultfolder && !p->copied) {
/* copy it to the default inbox */
+ filtered = TRUE;
filter_driver_log (driver, FILTER_LOG_ACTION, "Copy to default folder");
mail_tool_camel_lock_up ();
camel_folder_append_message (p->defaultfolder, p->message, p->info, p->ex);
@@ -793,7 +796,7 @@ filter_driver_filter_message (FilterDriver *driver, CamelMimeMessage *message, C
/* *Now* we can set the DELETED flag... */
if (p->deleted)
- info->flags = info->flags | CAMEL_MESSAGE_DELETED;
+ info->flags = info->flags | CAMEL_MESSAGE_DELETED;
if (freeinfo) {
camel_flag_list_free (&info->user_flags);
@@ -805,5 +808,6 @@ filter_driver_filter_message (FilterDriver *driver, CamelMimeMessage *message, C
g_free (info);
}
- filter_driver_log (driver, FILTER_LOG_END, NULL);
+ if (filtered)
+ filter_driver_log (driver, FILTER_LOG_END, NULL);
}