From fae4cb33bc4130eef34f125a1ead840e08f6ad86 Mon Sep 17 00:00:00 2001 From: iequidoo Date: Mon, 15 Apr 2024 00:57:09 -0300 Subject: [PATCH] fix(python): Message::is_outgoing: Don't reload message from db There's no need to load an updated message state from the db to implement `is_outgoing()` and also this function is implicitly called in some tests where a message is already trashed and a call to `dc_get_msg()` generates an unexpected error. --- python/src/deltachat/message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/src/deltachat/message.py b/python/src/deltachat/message.py index ce11f1ed4..9ffd980c1 100644 --- a/python/src/deltachat/message.py +++ b/python/src/deltachat/message.py @@ -395,7 +395,7 @@ class Message: def is_outgoing(self): """Return True if Message is outgoing.""" - return self._msgstate in ( + return lib.dc_msg_get_state(self._dc_msg) in ( const.DC_STATE_OUT_PREPARING, const.DC_STATE_OUT_PENDING, const.DC_STATE_OUT_FAILED,