From 03224d610f89068b30571d94dee3cae77c34f221 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 16 Oct 2002 04:07:31 +0000 Subject: Add the new-mail-notify rule to the filter driver before adding the user 2002-10-15 Jeffrey Stedfast * mail-session.c (main_get_filter_driver): Add the new-mail-notify rule to the filter driver before adding the user defined filter rules so that we can be sure that the new-mail-notify rule gets invoked. Fixes bug #32328. * mail-composer-prefs.c (mail_composer_prefs_new_signature): Make sure that name[0] cannot ever be NULL. Should maybe fix bug #32230. svn path=/trunk/; revision=18374 --- mail/mail-session.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'mail/mail-session.c') diff --git a/mail/mail-session.c b/mail/mail-session.c index cb2e709a69..011f09edca 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -871,16 +871,7 @@ main_get_filter_driver (CamelSession *session, const char *type, CamelException fsearch = g_string_new (""); faction = g_string_new (""); - while ((rule = rule_context_next_rule (fc, rule, type))) { - g_string_truncate (fsearch, 0); - g_string_truncate (faction, 0); - - filter_rule_build_code (rule, fsearch); - filter_filter_build_action ((FilterFilter *)rule, faction); - - camel_filter_driver_add_rule (driver, rule->name, - fsearch->str, faction->str); - } + /* add the new-mail notification rule first to be sure that it gets invoked */ /* FIXME: we need a way to distinguish between filtering new mail and re-filtering a folder because both use the @@ -907,10 +898,23 @@ main_get_filter_driver (CamelSession *session, const char *type, CamelException camel_filter_driver_add_rule (driver, "new-mail-notification", "(begin #t)", faction->str); } + /* add the user-defined rules next */ + while ((rule = rule_context_next_rule (fc, rule, type))) { + g_string_truncate (fsearch, 0); + g_string_truncate (faction, 0); + + filter_rule_build_code (rule, fsearch); + filter_filter_build_action ((FilterFilter *)rule, faction); + + camel_filter_driver_add_rule (driver, rule->name, + fsearch->str, faction->str); + } + g_string_free (fsearch, TRUE); g_string_free (faction, TRUE); gtk_object_unref (GTK_OBJECT (fc)); + return driver; } -- cgit v1.2.3