diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-07-03 04:27:48 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-07-03 04:27:48 +0800 |
commit | 7e1ad6c2254a9c5d2e6b19757b016eec29235e58 (patch) | |
tree | 5ed098e91a2ff029d2807834cdab6f0d8513d6e4 /mail/folder-browser.c | |
parent | 8db5c3fbda0f6f457f1ce075affdc0430add1c88 (diff) | |
download | gsoc2013-evolution-7e1ad6c2254a9c5d2e6b19757b016eec29235e58.tar gsoc2013-evolution-7e1ad6c2254a9c5d2e6b19757b016eec29235e58.tar.gz gsoc2013-evolution-7e1ad6c2254a9c5d2e6b19757b016eec29235e58.tar.bz2 gsoc2013-evolution-7e1ad6c2254a9c5d2e6b19757b016eec29235e58.tar.lz gsoc2013-evolution-7e1ad6c2254a9c5d2e6b19757b016eec29235e58.tar.xz gsoc2013-evolution-7e1ad6c2254a9c5d2e6b19757b016eec29235e58.tar.zst gsoc2013-evolution-7e1ad6c2254a9c5d2e6b19757b016eec29235e58.zip |
Fixes bug #27263.
2002-07-02 Jeffrey Stedfast <fejj@ximian.com>
Fixes bug #27263.
* folder-browser.c (filter_subject): Decide the filter source type
based on the folder we are in (Sent/Outbox folders use
FILTER_SOURCE_OUTGOING).
(filter_sender): Same.
(filter_recipient): Here too.
(filter_mlist): And here.
(on_right_click): Set the fdata->source.
(filter_type_got_message): Pass fdata->source into
filter_gui_add_from_message().
(filter_mlist_uid): Same.
* mail-autofilter.c (filter_gui_add_from_message): Now takes a
source argument so that we don't always add incoming rules.
(filter_gui_add_from_mlist): Same.
svn path=/trunk/; revision=17352
Diffstat (limited to 'mail/folder-browser.c')
-rw-r--r-- | mail/folder-browser.c | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/mail/folder-browser.c b/mail/folder-browser.c index 19b35abb46..661bcb1f5d 100644 --- a/mail/folder-browser.c +++ b/mail/folder-browser.c @@ -1325,31 +1325,50 @@ vfolder_mlist (GtkWidget *w, FolderBrowser *fb) void filter_subject (GtkWidget *w, FolderBrowser *fb) { - filter_gui_add_from_message (fb->mail_display->current_message, AUTO_SUBJECT); + const char *source = FILTER_SOURCE_INCOMING; + + if (folder_browser_is_sent (fb) || folder_browser_is_outbox (fb)) + source = FILTER_SOURCE_OUTGOING; + + filter_gui_add_from_message (fb->mail_display->current_message, source, AUTO_SUBJECT); } void filter_sender (GtkWidget *w, FolderBrowser *fb) { - filter_gui_add_from_message (fb->mail_display->current_message, AUTO_FROM); + const char *source = FILTER_SOURCE_INCOMING; + + if (folder_browser_is_sent (fb) || folder_browser_is_outbox (fb)) + source = FILTER_SOURCE_OUTGOING; + + filter_gui_add_from_message (fb->mail_display->current_message, source, AUTO_FROM); } void filter_recipient (GtkWidget *w, FolderBrowser *fb) { - filter_gui_add_from_message (fb->mail_display->current_message, AUTO_TO); + const char *source = FILTER_SOURCE_INCOMING; + + if (folder_browser_is_sent (fb) || folder_browser_is_outbox (fb)) + source = FILTER_SOURCE_OUTGOING; + + filter_gui_add_from_message (fb->mail_display->current_message, source, AUTO_TO); } void filter_mlist (GtkWidget *w, FolderBrowser *fb) { + const char *source = FILTER_SOURCE_INCOMING; char *name; - + g_return_if_fail (fb->mail_display->current_message != NULL); - + + if (folder_browser_is_sent (fb) || folder_browser_is_outbox (fb)) + source = FILTER_SOURCE_OUTGOING; + name = header_raw_check_mailing_list(&((CamelMimePart *)fb->mail_display->current_message)->headers); if (name) { - filter_gui_add_from_mlist(name); + filter_gui_add_from_mlist(source, name); g_free(name); } } @@ -1359,6 +1378,7 @@ filter_mlist (GtkWidget *w, FolderBrowser *fb) /* popup api to vfolder/filter on X, based on current selection */ struct _filter_data { CamelFolder *folder; + const char *source; char *uid; int type; char *uri; @@ -1411,7 +1431,7 @@ filter_type_got_message(CamelFolder *folder, char *uid, CamelMimeMessage *msg, v struct _filter_data *data = d; if (msg) - filter_gui_add_from_message(msg, data->type); + filter_gui_add_from_message(msg, data->source, data->type); filter_data_free(data); } @@ -1430,7 +1450,7 @@ filter_type_uid(struct _filter_data *fdata, int type) static void filter_subject_uid (GtkWidget *w, struct _filter_data *fdata) { filter_type_uid(fdata, AUTO_SUBJECT); } static void filter_sender_uid(GtkWidget *w, struct _filter_data *fdata) { filter_type_uid(fdata, AUTO_FROM); } static void filter_recipient_uid(GtkWidget *w, struct _filter_data *fdata) { filter_type_uid(fdata, AUTO_TO); } -static void filter_mlist_uid(GtkWidget *w, struct _filter_data *fdata) { filter_gui_add_from_mlist(fdata->mlist); } +static void filter_mlist_uid(GtkWidget *w, struct _filter_data *fdata) { filter_gui_add_from_mlist(fdata->source, fdata->mlist); } void hide_none(GtkWidget *w, FolderBrowser *fb) @@ -1875,6 +1895,10 @@ on_right_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event fdata->uri = g_strdup(fb->uri); fdata->folder = fb->folder; camel_object_ref((CamelObject *)fdata->folder); + if (folder_browser_is_sent (fb) || folder_browser_is_outbox (fb)) + fdata->source = FILTER_SOURCE_OUTGOING; + else + fdata->source = FILTER_SOURCE_INCOMING; enable_mask &= ~SELECTION_SET; mname = camel_message_info_mlist(info); |