diff options
author | Marvin W <git@larma.de> | 2019-12-22 04:10:53 +0100 |
---|---|---|
committer | Marvin W <git@larma.de> | 2019-12-23 16:58:53 +0100 |
commit | a0a956ee0878d24bd06be7f5d75dc4ccd4e7901d (patch) | |
tree | cbb079649066c2001b6d6881137108e70eed9d3f /libdino/src/application.vala | |
parent | 3218dc0211ac717230fe03fad82681a626d968b5 (diff) | |
download | dino-a0a956ee0878d24bd06be7f5d75dc4ccd4e7901d.tar.gz dino-a0a956ee0878d24bd06be7f5d75dc4ccd4e7901d.zip |
Properly check Jids everywhere
Diffstat (limited to 'libdino/src/application.vala')
-rw-r--r-- | libdino/src/application.vala | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libdino/src/application.vala b/libdino/src/application.vala index 86283823..82d392f6 100644 --- a/libdino/src/application.vala +++ b/libdino/src/application.vala @@ -78,6 +78,12 @@ public interface Application : GLib.Application { while (jid[0] == '/') { jid = jid.substring(1); } + jid = Uri.unescape_string(jid); + try { + jid = new Xmpp.Jid(jid).to_string(); + } catch (Xmpp.InvalidJidError e) { + warning("Received invalid jid in xmpp:-URI: %s", e.message); + } string query = "message"; Gee.Map<string, string> options = new Gee.HashMap<string, string>(); if (m.length == 2) { @@ -85,7 +91,7 @@ public interface Application : GLib.Application { query = cmds[0]; for (int i = 1; i < cmds.length; ++i) { string[] opt = cmds[i].split("=", 2); - options[opt[0]] = opt.length == 2 ? opt[1] : ""; + options[Uri.unescape_string(opt[0])] = opt.length == 2 ? Uri.unescape_string(opt[1]) : ""; } } activate(); |