aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-07-25 02:01:05 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-07-25 02:01:05 +0000
commit7b3e30a658ce8fdc8c1080cee450579734d5b81a (patch)
tree071bd84aced8f3dc93b5614ee0dc75b221e6cc30 /src
parente80b60f834edd13192bee986183f3bb8eb45ed20 (diff)
added an option to filter junk mails before normal filtering.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1097 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r--src/inc.c13
-rw-r--r--src/prefs_common_dialog.c9
2 files changed, 19 insertions, 3 deletions
diff --git a/src/inc.c b/src/inc.c
index c73985b0..8c7ffaef 100644
--- a/src/inc.c
+++ b/src/inc.c
@@ -1,6 +1,6 @@
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2005 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2006 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1054,11 +1054,18 @@ static gint inc_drop_message(Pop3Session *session, const gchar *file)
fltinfo->flags.perm_flags = MSG_NEW|MSG_UNREAD;
fltinfo->flags.tmp_flags = MSG_RECEIVED;
- if (session->ac_prefs->filter_on_recv)
+ if (prefs_common.enable_junk &&
+ prefs_common.filter_junk_on_recv &&
+ prefs_common.filter_junk_before)
+ filter_apply(prefs_common.junk_fltlist, file, fltinfo);
+
+ if (!fltinfo->drop_done && session->ac_prefs->filter_on_recv)
filter_apply(prefs_common.fltlist, file, fltinfo);
+
if (!fltinfo->drop_done) {
if (prefs_common.enable_junk &&
- prefs_common.filter_junk_on_recv)
+ prefs_common.filter_junk_on_recv &&
+ !prefs_common.filter_junk_before)
filter_apply(prefs_common.junk_fltlist, file, fltinfo);
}
diff --git a/src/prefs_common_dialog.c b/src/prefs_common_dialog.c
index 23f24606..d32d6ea8 100644
--- a/src/prefs_common_dialog.c
+++ b/src/prefs_common_dialog.c
@@ -161,6 +161,7 @@ static struct JunkMail {
GtkWidget *entry_classify_cmd;
GtkWidget *entry_junkfolder;
GtkWidget *chkbtn_filter_on_recv;
+ GtkWidget *chkbtn_filter_before;
GtkWidget *chkbtn_delete_on_recv;
GtkWidget *chkbtn_mark_as_read;
} junk;
@@ -413,6 +414,8 @@ static PrefsUIData ui_data[] = {
prefs_set_data_from_entry, prefs_set_entry},
{"filter_junk_on_receive", &junk.chkbtn_filter_on_recv,
prefs_set_data_from_toggle, prefs_set_toggle},
+ {"filter_junk_before", &junk.chkbtn_filter_before,
+ prefs_set_data_from_toggle, prefs_set_toggle},
{"delete_junk_on_receive", &junk.chkbtn_delete_on_recv,
prefs_set_data_from_toggle, prefs_set_toggle},
{"mark_junk_as_read", &junk.chkbtn_mark_as_read,
@@ -1773,6 +1776,7 @@ static void prefs_junk_create(void)
GtkWidget *entry_junkfolder;
GtkWidget *btn_folder;
GtkWidget *chkbtn_filter_on_recv;
+ GtkWidget *chkbtn_filter_before;
GtkWidget *chkbtn_delete_on_recv;
GtkWidget *chkbtn_mark_as_read;
@@ -1895,8 +1899,12 @@ static void prefs_junk_create(void)
(vbox3, chkbtn_filter_on_recv,
_("Filter messages classified as junk on receiving"));
PACK_CHECK_BUTTON
+ (vbox3, chkbtn_filter_before,
+ _("Filter junk mails before normal filtering"));
+ PACK_CHECK_BUTTON
(vbox3, chkbtn_delete_on_recv,
_("Delete junk mails from server on receiving"));
+ SET_TOGGLE_SENSITIVITY (chkbtn_filter_on_recv, chkbtn_filter_before);
SET_TOGGLE_SENSITIVITY (chkbtn_filter_on_recv, chkbtn_delete_on_recv);
PACK_CHECK_BUTTON (vbox3, chkbtn_mark_as_read,
@@ -1908,6 +1916,7 @@ static void prefs_junk_create(void)
junk.entry_classify_cmd = entry_classify_cmd;
junk.entry_junkfolder = entry_junkfolder;
junk.chkbtn_filter_on_recv = chkbtn_filter_on_recv;
+ junk.chkbtn_filter_before = chkbtn_filter_before;
junk.chkbtn_delete_on_recv = chkbtn_delete_on_recv;
junk.chkbtn_mark_as_read = chkbtn_mark_as_read;
}