From 20c3a3f30e98363684e62277d4fe45d2ab70406c Mon Sep 17 00:00:00 2001 From: hiro Date: Wed, 4 Oct 2006 00:53:58 +0000 Subject: exclude junk mails from the number of new messages. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1208 ee746299-78ed-0310-b773-934348b2243d --- src/inc.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/inc.c') diff --git a/src/inc.c b/src/inc.c index 6c7dece1..c9228252 100644 --- a/src/inc.c +++ b/src/inc.c @@ -1045,6 +1045,7 @@ static gint inc_drop_message(Pop3Session *session, const gchar *file) FilterInfo *fltinfo; IncSession *inc_session = (IncSession *)(SESSION(session)->data); gint val; + gboolean is_junk = FALSE; g_return_val_if_fail(inc_session != NULL, DROP_ERROR); @@ -1065,8 +1066,11 @@ static gint inc_drop_message(Pop3Session *session, const gchar *file) if (prefs_common.enable_junk && prefs_common.filter_junk_on_recv && - prefs_common.filter_junk_before) + prefs_common.filter_junk_before) { filter_apply(prefs_common.junk_fltlist, file, fltinfo); + if (fltinfo->drop_done) + is_junk = TRUE; + } if (!fltinfo->drop_done && session->ac_prefs->filter_on_recv) filter_apply(prefs_common.fltlist, file, fltinfo); @@ -1074,8 +1078,11 @@ static gint inc_drop_message(Pop3Session *session, const gchar *file) if (!fltinfo->drop_done) { if (prefs_common.enable_junk && prefs_common.filter_junk_on_recv && - !prefs_common.filter_junk_before) + !prefs_common.filter_junk_before) { filter_apply(prefs_common.junk_fltlist, file, fltinfo); + if (fltinfo->drop_done) + is_junk = TRUE; + } } if (!fltinfo->drop_done) { @@ -1105,7 +1112,7 @@ static gint inc_drop_message(Pop3Session *session, const gchar *file) val = DROP_DELETE; else { val = DROP_OK; - if (fltinfo->actions[FLT_ACTION_MARK_READ] == FALSE) + if (!is_junk && fltinfo->actions[FLT_ACTION_MARK_READ] == FALSE) inc_session->new_msgs++; } -- cgit v1.2.3