XMPP invitation landing page, without javascript
Properly URL-encode the JID, needed for IRC transports
Georg Lukas 2017-02-13
parent b969375 · commit c483239
-rw-r--r--scripts/main.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/main.js b/scripts/main.js
index d0e996e..5c4e9c4 100644
--- a/scripts/main.js
+++ b/scripts/main.js
@@ -48,6 +48,10 @@
key_prefix = "muc.";
}
+ var jid_parts = display_data.jid.split("?");
+ jid_parts[0] = encodeURIComponent(jid_parts[0]) // URL-encode the JID only
+ display_data.jid = jid_parts.join("?");
+
// TODO: proper error checking / display / Creation of invitations
if (jid.search("@") <= 0) return {jid:"", name: "Somebody"};