aboutsummaryrefslogtreecommitdiff
path: root/src/inc.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-02-23 02:23:31 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-02-23 02:23:31 +0000
commit5ab25cdcd5f96e3580daf0c05840994eae5f25f9 (patch)
treec1bbb1d509b2ae6c9c5efee923c5279713f2b8c5 /src/inc.c
parentbe3e205455951322ee435203f1e707f4fb3ee51b (diff)
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
Diffstat (limited to 'src/inc.c')
-rw-r--r--src/inc.c17
1 files changed, 12 insertions, 5 deletions
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;