# HG changeset patch # User Goffi # Date 1631092612 -7200 # Node ID 6e34307319c00d3ebe72bcdd65f533f7d67f8654 # Parent 867a15f0547608d0fe81dac9818e13b608f720be plugin XEP-0353: fix jingle initiation on disco "Service Unavailable" error: When requesting disco info on a bare jid which is not in our roster, server may return "Service Unavailable" (to avoid leaking valid JIDs). In this case, the initiation was failing, this is now fixed by using empty categories in this case. diff -r 867a15f05476 -r 6e34307319c0 sat/plugins/plugin_xep_0353.py --- a/sat/plugins/plugin_xep_0353.py Wed Sep 08 11:16:48 2021 +0200 +++ b/sat/plugins/plugin_xep_0353.py Wed Sep 08 11:16:52 2021 +0200 @@ -19,7 +19,7 @@ from zope.interface import implementer from twisted.internet import defer from twisted.internet import reactor -from twisted.words.protocols.jabber import xmlstream, jid +from twisted.words.protocols.jabber import xmlstream, jid, error from twisted.words.xish import domish from wokkel import disco, iwokkel from sat.core.i18n import _, D_ @@ -85,8 +85,15 @@ if peer_jid.resource: return True - infos = await self.host.memory.disco.getInfos(client, peer_jid) - categories = {c for c, __ in infos.identities} + try: + infos = await self.host.memory.disco.getInfos(client, peer_jid) + except error.StanzaError as e: + if e.condition == "service-unavailable": + categories = {} + else: + raise e + else: + categories = {c for c, __ in infos.identities} if "component" in categories: # we don't use message initiation with components return True