aboutsummaryrefslogtreecommitdiffstats
path: root/filter/filter-driver.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2000-09-08 06:13:41 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-09-08 06:13:41 +0800
commitd7077dc7742bb9ed615e5ccb426c938be2adb824 (patch)
tree5f2d011ae727ae572118ebe2ee60ced85f6cca7a /filter/filter-driver.c
parent972c515f0fbcd96be5b87275c82376d9394a0078 (diff)
downloadgsoc2013-evolution-d7077dc7742bb9ed615e5ccb426c938be2adb824.tar.gz
gsoc2013-evolution-d7077dc7742bb9ed615e5ccb426c938be2adb824.tar.zst
gsoc2013-evolution-d7077dc7742bb9ed615e5ccb426c938be2adb824.zip
Modified to return a boolean value specifying whether or not the message
2000-09-07 Jeffrey Stedfast <fejj@helixcode.com> * filter-driver.c (filter_driver_run): Modified to return a boolean value specifying whether or not the message was filtered into a folder other than the default. The default mailbox can now also be specified as NULL if the message shouldn't be appended to it in the case that it's not filtered into some other folder. svn path=/trunk/; revision=5249
Diffstat (limited to 'filter/filter-driver.c')
-rw-r--r--filter/filter-driver.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/filter/filter-driver.c b/filter/filter-driver.c
index 0108ed02c6..a6d9d1f3be 100644
--- a/filter/filter-driver.c
+++ b/filter/filter-driver.c
@@ -373,7 +373,7 @@ free_key (gpointer key, gpointer value, gpointer user_data)
}
#endif
-void
+gboolean
filter_driver_run (FilterDriver *driver, CamelMimeMessage *message,
CamelFolder *inbox, enum _filter_source_t sourcetype,
gpointer unhook_func, gpointer unhook_data,
@@ -383,10 +383,12 @@ filter_driver_run (FilterDriver *driver, CamelMimeMessage *message,
ESExpResult *r;
GString *fsearch, *faction;
FilterFilter *rule;
+ gboolean filtered = FALSE;
gtk_object_ref (GTK_OBJECT (driver));
camel_object_ref (CAMEL_OBJECT (message));
- camel_object_ref (CAMEL_OBJECT (inbox));
+ if (inbox)
+ camel_object_ref (CAMEL_OBJECT (inbox));
p->ex = camel_exception_new ();
p->terminated = FALSE;
@@ -444,7 +446,7 @@ filter_driver_run (FilterDriver *driver, CamelMimeMessage *message,
g_string_free (fsearch, TRUE);
g_string_free (faction, TRUE);
- if (!p->deleted && g_hash_table_size (p->folders) == 0) {
+ if (!p->deleted && g_hash_table_size (p->folders) == 0 && inbox) {
/* copy it to the default inbox */
mail_tool_camel_lock_up ();
camel_folder_append_message (inbox, p->message, p->info, p->ex);
@@ -454,6 +456,8 @@ filter_driver_run (FilterDriver *driver, CamelMimeMessage *message,
camel_object_unhook_event (CAMEL_OBJECT (inbox), "folder_changed",
unhook_func, unhook_data);
mail_tool_camel_lock_down ();
+ } else {
+ filtered = TRUE;
}
/* close all folders that were opened for appending */
@@ -471,7 +475,10 @@ filter_driver_run (FilterDriver *driver, CamelMimeMessage *message,
camel_exception_free (p->ex);
camel_object_unref (CAMEL_OBJECT (message));
- camel_object_unref (CAMEL_OBJECT (inbox));
+ if (inbox)
+ camel_object_unref (CAMEL_OBJECT (inbox));
if (self_destruct)
gtk_object_unref (GTK_OBJECT (driver));
+
+ return filtered;
}