From cca5bc57027b22e65f52c289f6fe20816dfe331a Mon Sep 17 00:00:00 2001 From: mathieui Date: Tue, 1 Mar 2022 19:43:35 +0100 Subject: fix: slixmpp 1.8.0 breaking changes --- poezio/core/core.py | 4 +++- poezio/core/handlers.py | 6 ++++-- poezio/fixes.py | 5 ++++- poezio/multiuserchat.py | 5 ++++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/poezio/core/core.py b/poezio/core/core.py index 3ad15719..2f692b42 100644 --- a/poezio/core/core.py +++ b/poezio/core/core.py @@ -633,7 +633,9 @@ class Core: else: self.do_command(''.join(char_list), True) if self.status.show not in ('xa', 'away'): - self.xmpp.plugin['xep_0319'].idle() + asyncio.ensure_future( + self.xmpp.plugin['xep_0319'].idle() + ) self.doupdate() def save_config(self): diff --git a/poezio/core/handlers.py b/poezio/core/handlers.py index c344ebd3..370d3a85 100644 --- a/poezio/core/handlers.py +++ b/poezio/core/handlers.py @@ -98,8 +98,10 @@ class HandlerCore: self.core.xmpp.plugin['xep_0280'].enable() self.core.check_bookmark_storage(features) - self.core.xmpp.plugin['xep_0030'].get_info( - jid=self.core.xmpp.boundjid.domain, callback=callback) + asyncio.ensure_future( + self.core.xmpp.plugin['xep_0030'].get_info( + jid=self.core.xmpp.boundjid.domain, callback=callback) + ) def find_identities(self, _): asyncio.ensure_future( diff --git a/poezio/fixes.py b/poezio/fixes.py index f8de7b14..19c4fc13 100644 --- a/poezio/fixes.py +++ b/poezio/fixes.py @@ -8,6 +8,7 @@ TODO: Check that they are fixed and remove those hacks from slixmpp.stanza import Message from slixmpp.xmlstream import ET +import asyncio import logging log = logging.getLogger(__name__) @@ -22,7 +23,9 @@ def has_identity(xmpp, jid, identity, on_true=None, on_false=None): if not res and on_false is not None: on_false() - xmpp.plugin['xep_0030'].get_info(jid=jid, callback=_cb) + asyncio.ensure_future( + xmpp.plugin['xep_0030'].get_info(jid=jid, callback=_cb) + ) def get_room_form(xmpp, room, callback): diff --git a/poezio/multiuserchat.py b/poezio/multiuserchat.py index 30c36a77..efbef1c5 100644 --- a/poezio/multiuserchat.py +++ b/poezio/multiuserchat.py @@ -10,6 +10,7 @@ Add some facilities that are not available on the XEP_0045 slix plugin """ +import asyncio from xml.etree import ElementTree as ET from poezio.common import safeJID @@ -137,7 +138,9 @@ def join_groupchat(core, xmpp.plugin['xep_0045'].our_nicks[jid] = to.resource try: - xmpp.plugin['xep_0030'].get_info(jid=jid, callback=on_disco) + asyncio.ensure_future( + xmpp.plugin['xep_0030'].get_info(jid=jid, callback=on_disco) + ) except (IqError, IqTimeout): return core.information('Failed to retrieve messages', 'Error') -- cgit v1.2.3