aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs
diff options
context:
space:
mode:
authorSam Whited <sam@samwhited.com>2014-12-02 10:17:50 -0500
committerSam Whited <sam@samwhited.com>2014-12-02 10:17:50 -0500
commit29a7828c5f7316713c625cbf1765a4f82457c0b6 (patch)
treef73e16b2a319506deaa2fd1e0233847dde275ee6 /src/main/java/eu/siacs
parent4f9dd824577063eb25962d73a2c0069b31c92036 (diff)
Allow JIDs such as "example.net/@"
Diffstat (limited to 'src/main/java/eu/siacs')
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/jid/Jid.java5
1 files changed, 2 insertions, 3 deletions
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 cb37bde3..c40fa0b6 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;