From 5ab25cdcd5f96e3580daf0c05840994eae5f25f9 Mon Sep 17 00:00:00 2001 From: hiro Date: Fri, 23 Feb 2007 02:23:31 +0000 Subject: count filtered messages for new mail notification on IMAP filtering. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1557 ee746299-78ed-0310-b773-934348b2243d --- ChangeLog | 5 +++++ ChangeLog.ja | 5 +++++ src/inc.c | 17 ++++++++++++----- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 617dba35..e7a0fd8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-02-22 + + * src/inc.c: inc_remote_account_mail(): count filtered messages for + new mail notification. + 2007-02-22 * libsylph/session.c: win32: fixed a bug that the timeout didn't work. diff --git a/ChangeLog.ja b/ChangeLog.ja index 30d23b74..0a471095 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,3 +1,8 @@ +2007-02-22 + + * src/inc.c: inc_remote_account_mail(): 新着通知のために振り分け + られたメッセージをカウントするようにした。 + 2007-02-22 * libsylph/session.c: win32: タイムアウトが機能しないバグを修正。 diff --git a/src/inc.c b/src/inc.c index 95f3573a..7debbe49 100644 --- a/src/inc.c +++ b/src/inc.c @@ -240,7 +240,7 @@ void inc_mail(MainWindow *mainwin) static gint inc_remote_account_mail(MainWindow *mainwin, PrefsAccount *account) { FolderItem *item = mainwin->summaryview->folder_item; - gint new_msgs; + gint new_msgs = 0; gboolean update_summary = FALSE; g_return_val_if_fail(account->folder != NULL, 0); @@ -265,10 +265,17 @@ static gint inc_remote_account_mail(MainWindow *mainwin, PrefsAccount *account) filter_apply_msginfo(prefs_common.fltlist, msginfo, fltinfo); if (fltinfo->actions[FLT_ACTION_MOVE] && - fltinfo->move_dest) + fltinfo->move_dest) { folder_item_move_msg (fltinfo->move_dest, msginfo); - else if (fltinfo->actions[FLT_ACTION_DELETE]) + if (account->imap_check_inbox_only || + fltinfo->move_dest->folder != + inbox->folder) { + if (MSG_IS_NEW(fltinfo->flags) || + MSG_IS_UNREAD(fltinfo->flags)) + ++new_msgs; + } + } else if (fltinfo->actions[FLT_ACTION_DELETE]) folder_item_remove_msg(inbox, msginfo); if (fltinfo->drop_done) ++n_filtered; @@ -288,12 +295,12 @@ static gint inc_remote_account_mail(MainWindow *mainwin, PrefsAccount *account) if (account->protocol == A_IMAP4 && account->imap_check_inbox_only) { FolderItem *inbox = FOLDER(account->folder)->inbox; - new_msgs = folderview_check_new_item(inbox); + new_msgs += folderview_check_new_item(inbox); if (!prefs_common.scan_all_after_inc && item != NULL && inbox == item) update_summary = TRUE; } else { - new_msgs = folderview_check_new(FOLDER(account->folder)); + new_msgs += folderview_check_new(FOLDER(account->folder)); if (!prefs_common.scan_all_after_inc && item != NULL && FOLDER(account->folder) == item->folder) update_summary = TRUE; -- cgit v1.2.3