Revision 712 src/summaryview.c
| summaryview.c (revision 712) | ||
|---|---|---|
| 3948 | 3948 |
FilterRule rule = {NULL, FLT_OR, NULL, NULL, FLT_TIMING_ANY, TRUE};
|
| 3949 | 3949 |
FilterAction action1 = {FLT_ACTION_EXEC, NULL, 0};
|
| 3950 | 3950 |
FilterAction action2 = {FLT_ACTION_MOVE, NULL, 0};
|
| 3951 |
FilterAction action3 = {FLT_ACTION_MARK_READ, NULL, 0};
|
|
| 3951 | 3952 |
SummaryView *summaryview = (SummaryView *)data; |
| 3952 | 3953 |
MsgInfo *msginfo; |
| 3953 | 3954 |
FilterInfo *fltinfo; |
| ... | ... | |
| 3964 | 3965 |
rule.action_list = g_slist_append(rule.action_list, &action1); |
| 3965 | 3966 |
if (prefs_common.junk_folder) |
| 3966 | 3967 |
rule.action_list = g_slist_append(rule.action_list, &action2); |
| 3968 |
if (prefs_common.mark_junk_as_read) |
|
| 3969 |
rule.action_list = g_slist_append(rule.action_list, &action3); |
|
| 3967 | 3970 |
|
| 3968 | 3971 |
fltinfo = filter_info_new(); |
| 3972 |
fltinfo->flags = msginfo->flags; |
|
| 3969 | 3973 |
|
| 3970 | 3974 |
ret = filter_action_exec(&rule, msginfo, file, fltinfo); |
| 3971 | 3975 |
|
| 3972 |
if (ret == 0 && MSG_IS_UNREAD(msginfo->flags)) {
|
|
| 3973 |
summary_mark_row_as_read(summaryview, iter); |
|
| 3974 |
if (MSG_IS_IMAP(msginfo->flags)) |
|
| 3975 |
imap_msg_unset_perm_flags |
|
| 3976 |
(msginfo, MSG_NEW | MSG_UNREAD); |
|
| 3976 |
if (ret == 0 && |
|
| 3977 |
msginfo->flags.perm_flags != fltinfo->flags.perm_flags) {
|
|
| 3978 |
msginfo->flags = fltinfo->flags; |
|
| 3979 |
summary_set_row(summaryview, iter, msginfo); |
|
| 3980 |
if (MSG_IS_IMAP(msginfo->flags)) {
|
|
| 3981 |
if (fltinfo->actions[FLT_ACTION_MARK_READ]) |
|
| 3982 |
imap_msg_unset_perm_flags(msginfo, |
|
| 3983 |
MSG_NEW | MSG_UNREAD); |
|
| 3984 |
} |
|
| 3977 | 3985 |
} |
| 3978 | 3986 |
if (ret == 0 && fltinfo->actions[FLT_ACTION_MOVE] && fltinfo->move_dest) |
| 3979 | 3987 |
summary_move_row_to(summaryview, iter, fltinfo->move_dest); |
Also available in: Unified diff