fix: slixmpp 1.8.0 breaking changes

This commit is contained in:
mathieui 2022-03-01 19:43:35 +01:00
parent d8785ae0bd
commit cca5bc5702
4 changed files with 15 additions and 5 deletions

View file

@ -633,7 +633,9 @@ class Core:
else: else:
self.do_command(''.join(char_list), True) self.do_command(''.join(char_list), True)
if self.status.show not in ('xa', 'away'): 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() self.doupdate()
def save_config(self): def save_config(self):

View file

@ -98,8 +98,10 @@ class HandlerCore:
self.core.xmpp.plugin['xep_0280'].enable() self.core.xmpp.plugin['xep_0280'].enable()
self.core.check_bookmark_storage(features) self.core.check_bookmark_storage(features)
self.core.xmpp.plugin['xep_0030'].get_info( asyncio.ensure_future(
jid=self.core.xmpp.boundjid.domain, callback=callback) self.core.xmpp.plugin['xep_0030'].get_info(
jid=self.core.xmpp.boundjid.domain, callback=callback)
)
def find_identities(self, _): def find_identities(self, _):
asyncio.ensure_future( asyncio.ensure_future(

View file

@ -8,6 +8,7 @@ TODO: Check that they are fixed and remove those hacks
from slixmpp.stanza import Message from slixmpp.stanza import Message
from slixmpp.xmlstream import ET from slixmpp.xmlstream import ET
import asyncio
import logging import logging
log = logging.getLogger(__name__) 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: if not res and on_false is not None:
on_false() 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): def get_room_form(xmpp, room, callback):

View file

@ -10,6 +10,7 @@ Add some facilities that are not available on the XEP_0045
slix plugin slix plugin
""" """
import asyncio
from xml.etree import ElementTree as ET from xml.etree import ElementTree as ET
from poezio.common import safeJID from poezio.common import safeJID
@ -137,7 +138,9 @@ def join_groupchat(core,
xmpp.plugin['xep_0045'].our_nicks[jid] = to.resource xmpp.plugin['xep_0045'].our_nicks[jid] = to.resource
try: 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): except (IqError, IqTimeout):
return core.information('Failed to retrieve messages', 'Error') return core.information('Failed to retrieve messages', 'Error')