diff --git a/src/paperless_mail/mail.py b/src/paperless_mail/mail.py index bc35f0e0d..0e9294927 100644 --- a/src/paperless_mail/mail.py +++ b/src/paperless_mail/mail.py @@ -44,7 +44,7 @@ class MarkReadMailAction(BaseMailAction): return {"seen": False} def post_consume(self, M, message_uids, parameter): - M.seen(message_uids, True) + M.flag(message_uids, [MailMessageFlags.SEEN], True) class MoveMailAction(BaseMailAction): diff --git a/src/paperless_mail/tests/test_mail.py b/src/paperless_mail/tests/test_mail.py index b1f6ef807..10aa431db 100644 --- a/src/paperless_mail/tests/test_mail.py +++ b/src/paperless_mail/tests/test_mail.py @@ -68,11 +68,6 @@ class BogusMailBox(ContextManager): return list(msg) - def seen(self, uid_list, seen_val): - for message in self.messages: - if message.uid in uid_list: - message.seen = seen_val - def delete(self, uid_list): self.messages = list(filter(lambda m: m.uid not in uid_list, self.messages)) @@ -82,6 +77,8 @@ class BogusMailBox(ContextManager): for flag in flag_set: if flag == MailMessageFlags.FLAGGED: message.flagged = value + if flag == MailMessageFlags.SEEN: + message.seen = value def move(self, uid_list, folder): if folder == "spam":