diff options
author | mathieui <mathieui@mathieui.net> | 2017-02-14 01:00:41 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2017-02-14 01:00:41 +0100 |
commit | cc4522d9cd256489459c2611e867dece52449363 (patch) | |
tree | a9d0b87fd24ca123d25029a77ffc2dd3d0c9d7cc /examples/custom_stanzas/custom_stanza_user.py | |
parent | 5bf69dca763d6ef4fe21636ff1b606d042942e71 (diff) | |
download | slixmpp-cc4522d9cd256489459c2611e867dece52449363.tar.gz slixmpp-cc4522d9cd256489459c2611e867dece52449363.tar.bz2 slixmpp-cc4522d9cd256489459c2611e867dece52449363.tar.xz slixmpp-cc4522d9cd256489459c2611e867dece52449363.zip |
Fix custom stanza examples
Diffstat (limited to 'examples/custom_stanzas/custom_stanza_user.py')
-rwxr-xr-x | examples/custom_stanzas/custom_stanza_user.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/custom_stanzas/custom_stanza_user.py b/examples/custom_stanzas/custom_stanza_user.py index c5630584..4119aa97 100755 --- a/examples/custom_stanzas/custom_stanza_user.py +++ b/examples/custom_stanzas/custom_stanza_user.py @@ -43,7 +43,7 @@ class ActionUserBot(slixmpp.ClientXMPP): register_stanza_plugin(Iq, Action) - def start(self, event): + async def start(self, event): """ Process the session_start event. @@ -57,11 +57,11 @@ class ActionUserBot(slixmpp.ClientXMPP): data. """ self.send_presence() - self.get_roster() + await self.get_roster() - self.send_custom_iq() + await self.send_custom_iq() - def send_custom_iq(self): + async def send_custom_iq(self): """Create and send two custom actions. If the first action was successful, then send @@ -74,14 +74,14 @@ class ActionUserBot(slixmpp.ClientXMPP): iq['action']['param'] = '2' try: - resp = iq.send() + resp = await iq.send() if resp['action']['status'] == 'done': #sending bye iq2 = self.Iq() iq2['to'] = self.action_provider iq2['type'] = 'set' iq2['action']['method'] = 'bye' - iq2.send(block=False) + await iq2.send() self.disconnect() except XMPPError: |