From b347d57848c423ecc7fef33f3c6b0b2856566a38 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sun, 17 May 2020 08:53:44 +0200 Subject: [PATCH] =?UTF-8?q?don=E2=80=99t=20escape=20jids=20when=20parsing?= =?UTF-8?q?=20from=20uri?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/eu/siacs/conversations/utils/XmppUri.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/utils/XmppUri.java b/src/main/java/eu/siacs/conversations/utils/XmppUri.java index b33b2ff66..9b27a123a 100644 --- a/src/main/java/eu/siacs/conversations/utils/XmppUri.java +++ b/src/main/java/eu/siacs/conversations/utils/XmppUri.java @@ -34,7 +34,7 @@ public class XmppUri { parse(Uri.parse(uri)); } catch (IllegalArgumentException e) { try { - jid = Jid.of(uri).asBareJid().toString(); + jid = Jid.ofEscaped(uri).asBareJid().toEscapedString(); } catch (IllegalArgumentException e2) { jid = null; } @@ -137,7 +137,7 @@ public class XmppUri { if (segments.size() >= 2 && segments.get(1).contains("@")) { // sample : https://conversations.im/i/foo@bar.com try { - jid = Jid.of(lameUrlDecode(segments.get(1))).toString(); + jid = Jid.ofEscaped(lameUrlDecode(segments.get(1))).toEscapedString(); } catch (Exception e) { jid = null; } @@ -173,7 +173,7 @@ public class XmppUri { } } else { try { - jid = Jid.of(uri.toString()).asBareJid().toString(); + jid = Jid.ofEscaped(uri.toString()).asBareJid().toEscapedString(); } catch (final IllegalArgumentException ignored) { jid = null; } @@ -195,7 +195,7 @@ public class XmppUri { public Jid getJid() { try { - return this.jid == null ? null : Jid.of(this.jid); + return this.jid == null ? null : Jid.ofEscaped(this.jid); } catch (IllegalArgumentException e) { return null; } @@ -206,7 +206,7 @@ public class XmppUri { return false; } try { - Jid.of(jid); + Jid.ofEscaped(jid); return true; } catch (IllegalArgumentException e) { return false;