From c005f3738c32bb6766d5839ff6c3ebb3057864cf Mon Sep 17 00:00:00 2001 From: hiro Date: Tue, 25 Nov 2008 08:28:26 +0000 Subject: 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 --- ChangeLog | 6 ++++++ ChangeLog.ja | 5 +++++ libsylph/mbox.c | 16 ++++++++++++---- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8f7c567b..8a5c2996 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-11-25 + + * libsylph/mbox.c: proc_mbox_full(): only count for non-junk and + not-deleted and not-marked-as-read messages (thanks to Otinov + Sergey). + 2008-11-25 * src/foldersel.[ch] diff --git a/ChangeLog.ja b/ChangeLog.ja index e878611e..fa9cbdfa 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,3 +1,8 @@ +2008-11-25 + + * libsylph/mbox.c: proc_mbox_full(): 非迷惑メール・非削除・未読の + メッセージのみカウントするようにした(Otinov Sergey さん thanks)。 + 2008-11-25 * src/foldersel.[ch] 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; } -- cgit v1.2.3