aboutsummaryrefslogtreecommitdiff
path: root/libsylph/mbox.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2008-11-25 08:28:26 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2008-11-25 08:28:26 +0000
commitc005f3738c32bb6766d5839ff6c3ebb3057864cf (patch)
tree3b876db56946323495bc0174f70b1bfa93ab3877 /libsylph/mbox.c
parentc46b00d19d0e6efb43f26c9d2304d600139abbd6 (diff)
only count for non-junk and not-deleted and not-marked-as-read messages when incorporating from mbox.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2078 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph/mbox.c')
-rw-r--r--libsylph/mbox.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/libsylph/mbox.c b/libsylph/mbox.c
index 72c2c5f4..17511697 100644
--- a/libsylph/mbox.c
+++ b/libsylph/mbox.c
@@ -1,6 +1,6 @@
/*
* LibSylph -- E-Mail client library
- * Copyright (C) 1999-2007 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2008 Hiroyuki Yamamoto
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -113,6 +113,7 @@ gint proc_mbox_full(FolderItem *dest, const gchar *mbox,
gchar *startp, *endp, *rpath;
gint empty_line;
gboolean is_next_msg = FALSE;
+ gboolean is_junk = FALSE;
FilterInfo *fltinfo;
if ((tmp_fp = g_fopen(tmp_file, "wb")) == NULL) {
@@ -218,6 +219,8 @@ gint proc_mbox_full(FolderItem *dest, const gchar *mbox,
prefs_common.filter_junk_before) {
filter_apply(prefs_common.junk_fltlist, tmp_file,
fltinfo);
+ if (fltinfo->drop_done)
+ is_junk = TRUE;
}
if (!fltinfo->drop_done && apply_filter)
@@ -228,6 +231,8 @@ gint proc_mbox_full(FolderItem *dest, const gchar *mbox,
!prefs_common.filter_junk_before) {
filter_apply(prefs_common.junk_fltlist, tmp_file,
fltinfo);
+ if (fltinfo->drop_done)
+ is_junk = TRUE;
}
if (fltinfo->actions[FLT_ACTION_MOVE] == FALSE &&
@@ -262,15 +267,18 @@ gint proc_mbox_full(FolderItem *dest, const gchar *mbox,
}
}
+ if (!is_junk &&
+ fltinfo->actions[FLT_ACTION_DELETE] == FALSE &&
+ fltinfo->actions[FLT_ACTION_MARK_READ] == FALSE)
+ msgs++;
+
filter_info_free(fltinfo);
g_unlink(tmp_file);
-
- msgs++;
} while (from_line[0] != '\0');
g_free(tmp_file);
fclose(mbox_fp);
- debug_print(_("%d messages found.\n"), msgs);
+ debug_print("%d new messages found.\n", msgs);
return msgs;
}