diff --git a/deltachat-rpc-client/tests/conftest.py b/deltachat-rpc-client/tests/conftest.py index e7899f7c5..19b106728 100644 --- a/deltachat-rpc-client/tests/conftest.py +++ b/deltachat-rpc-client/tests/conftest.py @@ -171,7 +171,7 @@ class DirectImap: self.conn.append(bytes(msg, encoding="ascii"), folder) def get_uid_by_message_id(self, message_id) -> str: - msgs = [msg.uid for msg in self.conn.fetch(AND(header=Header("MESSAGE-ID", message_id)))] + msgs = [msg.uid for msg in self.conn.fetch(AND(header=Header("MESSAGE-ID", message_id)), mark_seen=False)] if len(msgs) == 0: raise Exception("Did not find message " + message_id + ", maybe you forgot to select the correct folder?") return msgs[0] diff --git a/python/src/deltachat/direct_imap.py b/python/src/deltachat/direct_imap.py index 35491e41b..9a7297363 100644 --- a/python/src/deltachat/direct_imap.py +++ b/python/src/deltachat/direct_imap.py @@ -104,11 +104,11 @@ class DirectImap: def get_all_messages(self) -> List[MailMessage]: assert not self._idling - return list(self.conn.fetch()) + return list(self.conn.fetch(mark_seen=False)) def get_unread_messages(self) -> List[str]: assert not self._idling - return [msg.uid for msg in self.conn.fetch(AND(seen=False))] + return [msg.uid for msg in self.conn.fetch(AND(seen=False), mark_seen=False)] def mark_all_read(self): messages = self.get_unread_messages() @@ -183,7 +183,7 @@ class DirectImap: self.conn.append(bytes(msg, encoding="ascii"), folder) def get_uid_by_message_id(self, message_id) -> str: - msgs = [msg.uid for msg in self.conn.fetch(AND(header=Header("MESSAGE-ID", message_id)))] + msgs = [msg.uid for msg in self.conn.fetch(AND(header=Header("MESSAGE-ID", message_id)), mark_seen=False)] if len(msgs) == 0: raise Exception("Did not find message " + message_id + ", maybe you forgot to select the correct folder?") return msgs[0]