Fix xmpp: URI handling.

It was previously removing the first three characters of the JID, and
ignored any URI without an action.
This commit is contained in:
Emmanuel Gil Peyrot 2017-12-15 02:40:53 +01:00
parent 4009625e02
commit 0707f1a27c
1 changed files with 6 additions and 4 deletions

View File

@ -239,13 +239,15 @@ class GajimApplication(Gtk.Application):
for arg in file: for arg in file:
uri = arg.get_uri() uri = arg.get_uri()
app.log('uri_handler').info('open %s', uri) app.log('uri_handler').info('open %s', uri)
# remove xmpp:/// if not uri.startswith('xmpp:'):
uri = uri[8:] continue
# remove xmpp:
uri = uri[5:]
try: try:
jid, cmd = uri.split('?') jid, cmd = uri.split('?')
except ValueError: except ValueError:
# Invalid URI # No query argument
return jid, cmd = uri, 'message'
if cmd == 'join': if cmd == 'join':
self.interface.join_gc_minimal(None, jid) self.interface.join_gc_minimal(None, jid)
elif cmd == 'roster': elif cmd == 'roster':