From f1ab9ab96468d4753da169968095dd08500a0f42 Mon Sep 17 00:00:00 2001 From: mathieui Date: Sat, 2 May 2020 16:47:04 +0200 Subject: Change session_start callback to async in most examples If we fetch the roster, we should probably wait until we get it back --- examples/adhoc_user.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/adhoc_user.py') diff --git a/examples/adhoc_user.py b/examples/adhoc_user.py index 8bdb675b..d86dc679 100755 --- a/examples/adhoc_user.py +++ b/examples/adhoc_user.py @@ -37,7 +37,7 @@ class CommandUserBot(slixmpp.ClientXMPP): self.add_event_handler("session_start", self.start) self.add_event_handler("message", self.message) - def start(self, event): + async def start(self, event): """ Process the session_start event. @@ -51,7 +51,7 @@ class CommandUserBot(slixmpp.ClientXMPP): data. """ self.send_presence() - self.get_roster() + await self.get_roster() # We first create a session dictionary containing: # 'next' -- the handler to execute on a successful response -- cgit v1.2.3