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:
uri = arg.get_uri()
app.log('uri_handler').info('open %s', uri)
# remove xmpp:///
uri = uri[8:]
if not uri.startswith('xmpp:'):
continue
# remove xmpp:
uri = uri[5:]
try:
jid, cmd = uri.split('?')
except ValueError:
# Invalid URI
return
# No query argument
jid, cmd = uri, 'message'
if cmd == 'join':
self.interface.join_gc_minimal(None, jid)
elif cmd == 'roster':