From 29a7828c5f7316713c625cbf1765a4f82457c0b6 Mon Sep 17 00:00:00 2001 From: Sam Whited Date: Tue, 2 Dec 2014 10:17:50 -0500 Subject: Allow JIDs such as "example.net/@" --- src/main/java/eu/siacs/conversations/xmpp/jid/Jid.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main/java/eu/siacs/conversations/xmpp/jid/Jid.java b/src/main/java/eu/siacs/conversations/xmpp/jid/Jid.java index cb37bde3d..c40fa0b65 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jid/Jid.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jid/Jid.java @@ -70,10 +70,9 @@ public final class Jid { } // Go ahead and check if the localpart or resourcepart is empty. - if (jid.startsWith("@") || jid.endsWith("@") || - jid.startsWith("/") || jid.endsWith("/")) { + if (jid.startsWith("@") || (jid.endsWith("@") && slashCount == 0) || jid.startsWith("/") || (jid.endsWith("/") && slashCount < 2)) { throw new InvalidJidException(InvalidJidException.INVALID_CHARACTER); - } + } String finaljid; -- cgit v1.2.3