From 81fb54c14df19130b7d99f88da6141918c085b07 Mon Sep 17 00:00:00 2001 From: Brendan Howell Date: Sat, 28 Jan 2017 18:46:36 +0100 Subject: [PATCH] mark_unread method for mail room --- screenless/bureau/mailroom/mailroom.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/screenless/bureau/mailroom/mailroom.py b/screenless/bureau/mailroom/mailroom.py index d5af694..ae8e6ec 100644 --- a/screenless/bureau/mailroom/mailroom.py +++ b/screenless/bureau/mailroom/mailroom.py @@ -180,6 +180,16 @@ class MailRoom(Bureau): self.imapserv.delete_messages((imap_id)) self.imapserv.expunge() + @add_command("un", "Mark as unread") + def mark_unread(self, data): + """ + Flags an email as unseen (so you can deal with it later). + """ + shortcode, _ = data.split(".") + imap_id = self.get_imap_id(shortcode) + self._connect_imap() + self.imapserv.remove_flags(imap_id, [imapclient.SEEN]) + @add_command("re", "Reply with scan") def reply_scan(self, data): """