aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-07-03 04:27:48 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-07-03 04:27:48 +0800
commit7e1ad6c2254a9c5d2e6b19757b016eec29235e58 (patch)
tree5ed098e91a2ff029d2807834cdab6f0d8513d6e4 /mail
parent8db5c3fbda0f6f457f1ce075affdc0430add1c88 (diff)
downloadgsoc2013-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')
-rw-r--r--mail/ChangeLog19
-rw-r--r--mail/folder-browser.c40
-rw-r--r--mail/mail-autofilter.c8
-rw-r--r--mail/mail-autofilter.h4
4 files changed, 56 insertions, 15 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 930cc4e57b..af0187e061 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,7 +1,24 @@
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.
+
* mail-tools.c (mail_tool_make_message_attachment): Remove Bcc
- headers too.
+ headers too. Fixes bug #27302.
2002-07-02 Ettore Perazzoli <ettore@ximian.com>
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);
diff --git a/mail/mail-autofilter.c b/mail/mail-autofilter.c
index 34534652d1..a4807b1f32 100644
--- a/mail/mail-autofilter.c
+++ b/mail/mail-autofilter.c
@@ -325,7 +325,7 @@ filter_rule_from_mlist (FilterContext *context, const char *mlist)
}
void
-filter_gui_add_from_message (CamelMimeMessage *msg, int flags)
+filter_gui_add_from_message (CamelMimeMessage *msg, const char *source, int flags)
{
FilterContext *fc;
char *user, *system;
@@ -339,7 +339,7 @@ filter_gui_add_from_message (CamelMimeMessage *msg, int flags)
rule_context_load ((RuleContext *)fc, system, user);
rule = filter_rule_from_message (fc, msg, flags);
- filter_rule_set_source (rule, FILTER_SOURCE_INCOMING);
+ filter_rule_set_source (rule, source);
rule_context_add_rule_gui ((RuleContext *)fc, rule, _("Add Filter Rule"), user);
g_free (user);
@@ -347,7 +347,7 @@ filter_gui_add_from_message (CamelMimeMessage *msg, int flags)
}
void
-filter_gui_add_from_mlist (const char *mlist)
+filter_gui_add_from_mlist (const char *source, const char *mlist)
{
FilterContext *fc;
char *user, *system;
@@ -359,7 +359,7 @@ filter_gui_add_from_mlist (const char *mlist)
rule_context_load ((RuleContext *)fc, system, user);
rule = filter_rule_from_mlist(fc, mlist);
- filter_rule_set_source (rule, FILTER_SOURCE_INCOMING);
+ filter_rule_set_source (rule, source);
rule_context_add_rule_gui ((RuleContext *)fc, rule, _("Add Filter Rule"), user);
g_free (user);
diff --git a/mail/mail-autofilter.h b/mail/mail-autofilter.h
index 5a2dbe52e5..ca7935411d 100644
--- a/mail/mail-autofilter.h
+++ b/mail/mail-autofilter.h
@@ -43,8 +43,8 @@ FilterRule *filter_rule_from_mlist(FilterContext *context, const char *mlist);
/* easiest place to put this */
-void filter_gui_add_from_message(CamelMimeMessage *msg, int flags);
-void filter_gui_add_from_mlist(const char *mlist);
+void filter_gui_add_from_message (CamelMimeMessage *msg, const char *source, int flags);
+void filter_gui_add_from_mlist (const char *source, const char *mlist);
/* Also easiest place for these, we should really share a global rule context for this stuff ... */
void mail_filter_rename_uri(CamelStore *store, const char *olduri, const char *newuri);