From 395a311fe36286101e2d82c13d2ad1227df3e8bb Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Tue, 12 Sep 2000 14:30:49 +0000 Subject: Cool Hack of the Day: right-click menu item to autodetect what mailing list a message comes from and create the rule for it on the fly. (Many thanks to Joakim for suggesting the way to implement this.) Also, use the new shiny toolbar icons from TigerT and mark some strings for translation. svn path=/trunk/; revision=5362 --- mail/message-list.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'mail/message-list.c') diff --git a/mail/message-list.c b/mail/message-list.c index 65f035fe5b..110f96912e 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -18,16 +18,20 @@ #include #include #include + #include "message-list.h" #include "message-thread.h" #include "mail-threads.h" #include "mail-tools.h" +#include "mail-mlist-magic.h" #include "mail-ops.h" #include "mail-config.h" #include "mail-vfolder.h" #include "mail-autofilter.h" #include "mail.h" + #include "Mail.h" + #include "widgets/e-table/e-table-header-item.h" #include "widgets/e-table/e-table-item.h" @@ -1204,6 +1208,25 @@ filter_recipient(GtkWidget *w, FolderBrowser *fb) filter_gui_add_from_message(fb->mail_display->current_message, AUTO_TO); } +void +filter_mlist (GtkWidget *w, FolderBrowser *fb) +{ + char *name; + char *header_value; + const char *header_name; + + name = mail_mlist_magic_detect_list (fb->mail_display->current_message, &header_name, &header_value); + if (name == NULL) { + g_print ("No fucking mlist!\n"); + return; + } + + filter_gui_add_for_mailing_list (fb->mail_display->current_message, name, header_name, header_value); + + g_free (name); + g_free (header_value); +} + static gint on_right_click (ETableScrolled *table, gint row, gint col, GdkEvent *event, MessageList *list) { @@ -1230,6 +1253,7 @@ on_right_click (ETableScrolled *table, gint row, gint col, GdkEvent *event, Mess { "Filter on Subject", NULL, GTK_SIGNAL_FUNC (filter_subject), 2 }, { "Filter on Sender", NULL, GTK_SIGNAL_FUNC (filter_sender), 2 }, { "Filter on Recipients", NULL, GTK_SIGNAL_FUNC (filter_recipient), 2 }, + { "Filter on Mailing List", NULL, GTK_SIGNAL_FUNC (filter_mlist), 2 }, { NULL, NULL, NULL, 0 } }; -- cgit v1.2.3