Commit a2f2028b authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Validate parsed xmpp: URIs

parent 5a8289b6
......@@ -59,6 +59,8 @@
from nbxmpp.util import compute_caps_hash
from nbxmpp.stringprepare import nameprep
from nbxmpp.structs import DiscoInfo
from nbxmpp.protocol import JID
from nbxmpp.protocol import InvalidJid
from gi.repository import GLib
import precis_i18n.codec # pylint: disable=unused-import
......@@ -1484,6 +1486,7 @@ def parse_uri(uri):
if uri.startswith('xmpp:'):
action, data = parse_uri_actions(uri)
return URI(type=URIType.XMPP,
......@@ -1603,3 +1606,10 @@ def get_default_muc_config():
'{}roomconfig_allowmemberinvites': True,
'muc#roomconfig_enablearchiving': True,
def validate_jid(jid):
return JID(str(jid))
except InvalidJid as error:
raise ValueError(error)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment