+ comment

This commit is contained in:
nicobo 2020-05-26 22:39:08 +02:00
parent 95e142ea81
commit 207ff6c394
No known key found for this signature in database
GPG key ID: 2581E71C5FA5285F

View file

@ -291,6 +291,7 @@ class JabberChatter(Chatter):
callback = lambda _: self.xmpp.connected_event.set()
self.xmpp.add_event_handler('session_start', callback)
self.xmpp.connect()
# TODO use asyncio.run() in latest python
loop = asyncio.get_event_loop()
loop.run_until_complete(self.xmpp.connected_event.wait())
logging.debug("Connected.")
@ -311,8 +312,7 @@ class JabberChatter(Chatter):
Sends the given message using the underlying implemented chat protocol
"""
logging.debug(">>> %s",message)
#loop = asyncio.get_event_loop()
# loop.run_until_complete(self.xmpp.encrypted_send( body=message, recipient=self.recipient ))
# TODO use asyncio.make_task() in latest python
asyncio.ensure_future( self.xmpp.encrypted_send( body=message, recipient=self.recipient ) )
def stop( self ):