From 7b3e30a658ce8fdc8c1080cee450579734d5b81a Mon Sep 17 00:00:00 2001 From: hiro Date: Tue, 25 Jul 2006 02:01:05 +0000 Subject: 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 --- ChangeLog | 7 +++++++ ChangeLog.ja | 7 +++++++ NEWS | 2 ++ libsylph/prefs_common.c | 2 ++ libsylph/prefs_common.h | 1 + src/inc.c | 13 ++++++++++--- src/prefs_common_dialog.c | 9 +++++++++ 7 files changed, 38 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index d0f0ea5e..0d6eee86 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-07-25 + + * libsylph/prefs_common.[ch] + src/inc.c + src/prefs_common_dialog.c: added an option to filter junk mails + before normal filtering. + 2006-07-24 * src/summaryview.c: added 'Set as (not) junk mail' to the context diff --git a/ChangeLog.ja b/ChangeLog.ja index f834c58b..6632a162 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,3 +1,10 @@ +2006-07-25 + + * libsylph/prefs_common.[ch] + src/inc.c + src/prefs_common_dialog.c: 通常のフィルタリングの前に迷惑メールを + 振り分けるオプションを追加。 + 2006-07-24 * src/summaryview.c: コンテキストメニューに「迷惑メールに指定/ diff --git a/NEWS b/NEWS index b0543b82..dd66baaf 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ Changes of Sylpheed * 2.2.7 (stable) * "Mark all read" was added to the folder context menu. + * "Set as (not) junk mail" was added to the summary context menu. + * The option to filter junk mails before normal filtering was added. * Win32: The scanning of folders was optimized so that receiving or moving of messages become faster when folders contain large number of messages. * The bug that manual junk filtering didn't work when no filter rule exist diff --git a/libsylph/prefs_common.c b/libsylph/prefs_common.c index 5c4bfca5..ead1bd23 100644 --- a/libsylph/prefs_common.c +++ b/libsylph/prefs_common.c @@ -291,6 +291,8 @@ static PrefParam param[] = { {"junk_folder", NULL, &prefs_common.junk_folder, P_STRING}, {"filter_junk_on_receive", "FALSE", &prefs_common.filter_junk_on_recv, P_BOOL}, + {"filter_junk_before", "FALSE", &prefs_common.filter_junk_before, + P_BOOL}, {"delete_junk_on_receive", "TRUE", &prefs_common.delete_junk_on_recv, P_BOOL}, {"mark_junk_as_read", "FALSE", &prefs_common.mark_junk_as_read, P_BOOL}, diff --git a/libsylph/prefs_common.h b/libsylph/prefs_common.h index 6f12e877..4abe2da6 100644 --- a/libsylph/prefs_common.h +++ b/libsylph/prefs_common.h @@ -213,6 +213,7 @@ struct _PrefsCommon gchar *junk_classify_cmd; gchar *junk_folder; gboolean filter_junk_on_recv; + gboolean filter_junk_before; gboolean delete_junk_on_recv; gboolean mark_junk_as_read; 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; @@ -1894,9 +1898,13 @@ static void prefs_junk_create(void) PACK_CHECK_BUTTON (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; } -- cgit v1.2.3