aboutsummaryrefslogtreecommitdiffstats
path: root/mail/message-list.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/message-list.c')
-rw-r--r--mail/message-list.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/mail/message-list.c b/mail/message-list.c
index 24fac02cbe..c2f9f127a8 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -2060,9 +2060,21 @@ on_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event, Mess
return FALSE;
}
- /* If a message was marked as deleted and the user flags it as important, undelete it */
- if ((col == COL_FLAGGED || col == COL_NEED_REPLY) && (info->flags & CAMEL_MESSAGE_DELETED))
- flag |= CAMEL_MESSAGE_DELETED;
+ /* If a message was marked as deleted and the user flags it as
+ important, marks it as needing a reply, marks it as unread,
+ then undelete the message. */
+ if (info->flags & CAMEL_MESSAGE_DELETED) {
+
+ if (col == COL_FLAGGED && !(info->flags & CAMEL_MESSAGE_FLAGGED))
+ flag |= CAMEL_MESSAGE_DELETED;
+
+ if (col == COL_NEED_REPLY && !(info->flags & CAMEL_MESSAGE_NEEDS_REPLY))
+ flag |= CAMEL_MESSAGE_DELETED;
+
+ if (col == COL_MESSAGE_STATUS && (info->flags & CAMEL_MESSAGE_SEEN))
+ flag |= CAMEL_MESSAGE_DELETED;
+
+ }
camel_folder_set_message_flags (list->folder, camel_message_info_uid (info), flag, ~info->flags);