Pass correct type, use full jid explicitly

This commit is contained in:
fawz 2019-12-10 17:04:11 +01:00
parent 9f1f538d78
commit 60badde5a7

View file

@ -361,8 +361,7 @@ class XEP_0384(BasePlugin):
async def _fetch_device_list(self, jid: JID) -> None:
"""Manually query PEP OMEMO_DEVICES_NS nodes"""
jid = JID(jid)
iq = await self.xmpp['xep_0060'].get_items(jid, OMEMO_DEVICES_NS)
iq = await self.xmpp['xep_0060'].get_items(jid.full, OMEMO_DEVICES_NS)
return await self._read_device_list(jid, iq['pubsub']['items'])
def _store_device_ids(self, jid: str, items: Union[Items, EventItems]) -> None:
@ -580,7 +579,7 @@ class XEP_0384(BasePlugin):
for exn in errors:
if isinstance(exn, omemo.exceptions.NoDevicesException):
await self._fetch_device_list(exn.bare_jid)
await self._fetch_device_list(JID(exn.bare_jid))
elif isinstance(exn, omemo.exceptions.MissingBundleException):
bundle = await self._fetch_bundle(exn.bare_jid, exn.device)
if bundle is not None: