aboutsummaryrefslogtreecommitdiff
path: root/src/summaryview.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-11-04 04:33:21 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-11-04 04:33:21 +0000
commitde0ef006b2bcae3fbddf0ee549cf96497a25ad9f (patch)
tree6cadc1282490c35ff7f06a5ff58085b835bfb0c2 /src/summaryview.c
parent8fa126852aebead7f883231584991c2c27ea56d9 (diff)
follow the 'mark_junk_as_read' setting when marking as junk.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@712 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/summaryview.c')
-rw-r--r--src/summaryview.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/summaryview.c b/src/summaryview.c
index 77d85e1d..bbd2d078 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -3948,6 +3948,7 @@ static void summary_junk_func(GtkTreeModel *model, GtkTreePath *path,
FilterRule rule = {NULL, FLT_OR, NULL, NULL, FLT_TIMING_ANY, TRUE};
FilterAction action1 = {FLT_ACTION_EXEC, NULL, 0};
FilterAction action2 = {FLT_ACTION_MOVE, NULL, 0};
+ FilterAction action3 = {FLT_ACTION_MARK_READ, NULL, 0};
SummaryView *summaryview = (SummaryView *)data;
MsgInfo *msginfo;
FilterInfo *fltinfo;
@@ -3964,16 +3965,23 @@ static void summary_junk_func(GtkTreeModel *model, GtkTreePath *path,
rule.action_list = g_slist_append(rule.action_list, &action1);
if (prefs_common.junk_folder)
rule.action_list = g_slist_append(rule.action_list, &action2);
+ if (prefs_common.mark_junk_as_read)
+ rule.action_list = g_slist_append(rule.action_list, &action3);
fltinfo = filter_info_new();
+ fltinfo->flags = msginfo->flags;
ret = filter_action_exec(&rule, msginfo, file, fltinfo);
- if (ret == 0 && MSG_IS_UNREAD(msginfo->flags)) {
- summary_mark_row_as_read(summaryview, iter);
- if (MSG_IS_IMAP(msginfo->flags))
- imap_msg_unset_perm_flags
- (msginfo, MSG_NEW | MSG_UNREAD);
+ if (ret == 0 &&
+ msginfo->flags.perm_flags != fltinfo->flags.perm_flags) {
+ msginfo->flags = fltinfo->flags;
+ summary_set_row(summaryview, iter, msginfo);
+ if (MSG_IS_IMAP(msginfo->flags)) {
+ if (fltinfo->actions[FLT_ACTION_MARK_READ])
+ imap_msg_unset_perm_flags(msginfo,
+ MSG_NEW | MSG_UNREAD);
+ }
}
if (ret == 0 && fltinfo->actions[FLT_ACTION_MOVE] && fltinfo->move_dest)
summary_move_row_to(summaryview, iter, fltinfo->move_dest);