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.
This commit is contained in:
iequidoo
2024-04-15 00:57:09 -03:00
committed by link2xt
parent 7a3be74350
commit fae4cb33bc

View File

@@ -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,