aboutsummaryrefslogtreecommitdiff
path: root/src/inc.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-10-04 00:53:58 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-10-04 00:53:58 +0000
commit20c3a3f30e98363684e62277d4fe45d2ab70406c (patch)
tree8cad7563936c4933e01f6bd7b5e550b14cc4c828 /src/inc.c
parent48663e5834d29b40fc7438dd832af4fb4e8816f9 (diff)
exclude junk mails from the number of new messages.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1208 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/inc.c')
-rw-r--r--src/inc.c13
1 files changed, 10 insertions, 3 deletions
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++;
}