api(deltachat-rpc-client): add Account.wait_for_incoming_msg()

This commit is contained in:
link2xt
2024-05-18 18:44:29 +00:00
parent 578f29f215
commit 20a4bb1a88
2 changed files with 16 additions and 11 deletions

View File

@@ -297,6 +297,12 @@ class Account:
if event.kind == EventType.INCOMING_MSG:
return event
def wait_for_incoming_msg(self):
"""Wait for incoming message and return it.
Consumes all events before the next incoming message event."""
return self.get_message_by_id(self.wait_for_incoming_msg_event().msg_id)
def wait_for_securejoin_inviter_success(self):
while True:
event = self.wait_for_event()