aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog11
-rw-r--r--mail/mail-composer-prefs.c17
-rw-r--r--mail/mail-session.c24
3 files changed, 35 insertions, 17 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 3e4413d57e..ce5a0fcac1 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,14 @@
+2002-10-15 Jeffrey Stedfast <fejj@ximian.com>
+
+ * 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.
+
2002-10-15 Dan Winship <danw@ximian.com>
* upgrade-mailer.c (shortcuts_upgrade_xml_file): Change the type
diff --git a/mail/mail-composer-prefs.c b/mail/mail-composer-prefs.c
index f64e844f2c..1fc0afb05f 100644
--- a/mail/mail-composer-prefs.c
+++ b/mail/mail-composer-prefs.c
@@ -227,24 +227,27 @@ MailConfigSignature *
mail_composer_prefs_new_signature (MailComposerPrefs *prefs, gboolean html, const gchar *script)
{
MailConfigSignature *sig;
- char *name [1];
+ char *name[1];
int row;
sig = mail_config_signature_add (html, script);
if (prefs) {
- name [0] = e_utf8_to_gtk_string (GTK_WIDGET (prefs->sig_clist), sig->name);
+ if (!(name[0] = e_utf8_to_gtk_string (GTK_WIDGET (prefs->sig_clist), sig->name)))
+ name[0] = g_strdup ("");
+
if (sig->script) {
- gchar *tmp;
-
- tmp = name [0];
- name [0] = g_strconcat (name [0], _(" [script]"), NULL);
+ char *tmp;
+
+ tmp = name[0];
+ name[0] = g_strconcat (tmp, _(" [script]"), NULL);
g_free (tmp);
}
+
row = gtk_clist_append (prefs->sig_clist, name);
gtk_clist_set_row_data (prefs->sig_clist, row, sig);
gtk_clist_select_row (GTK_CLIST (prefs->sig_clist), row, 0);
- g_free (name [0]);
+ g_free (name[0]);
/*gtk_widget_grab_focus (prefs->sig_name);*/
}
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;
}