aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/xmpp/jid
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2015-05-20 03:39:58 +0200
committerDaniel Gultsch <daniel@gultsch.de>2015-05-20 03:39:58 +0200
commit4f36aa39a4e8aa5128c12a713bd9d3d4d9b51469 (patch)
tree1a87a4e98b88f4e0eb3fc36bcee74f403acf0abe /src/main/java/eu/siacs/conversations/xmpp/jid
parentfbf81f59dbc17951faea945cca979312201d00fe (diff)
parent7824c01748a89688c5f76307cc1f4221a9e2ffb5 (diff)
Merge branch 'development'
Diffstat (limited to 'src/main/java/eu/siacs/conversations/xmpp/jid')
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/jid/Jid.java13
1 files changed, 10 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 295e067a..f989c0c2 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/jid/Jid.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/jid/Jid.java
@@ -130,12 +130,19 @@ public final class Jid {
if (resourcepart.isEmpty() || resourcepart.length() > 1023) {
throw new InvalidJidException(InvalidJidException.INVALID_PART_LENGTH);
}
- dp = IDN.toUnicode(jid.substring(domainpartStart, slashLoc), IDN.USE_STD3_ASCII_RULES);
+ try {
+ dp = IDN.toUnicode(Stringprep.nameprep(jid.substring(domainpartStart, slashLoc)), IDN.USE_STD3_ASCII_RULES);
+ } catch (final StringprepException e) {
+ throw new InvalidJidException(InvalidJidException.STRINGPREP_FAIL, e);
+ }
finaljid = finaljid + dp + "/" + rp;
} else {
resourcepart = "";
- dp = IDN.toUnicode(jid.substring(domainpartStart, jid.length()),
- IDN.USE_STD3_ASCII_RULES);
+ try{
+ dp = IDN.toUnicode(Stringprep.nameprep(jid.substring(domainpartStart, jid.length())), IDN.USE_STD3_ASCII_RULES);
+ } catch (final StringprepException e) {
+ throw new InvalidJidException(InvalidJidException.STRINGPREP_FAIL, e);
+ }
finaljid = finaljid + dp;
}