aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/utils
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-05-29 22:03:57 +0200
committerChristian Schneppe <christian@pix-art.de>2016-05-29 22:03:57 +0200
commitdb7920aa9e57e5b4c35800136eaa53f7ae9de2c7 (patch)
tree7df4b6c9c4d082b71c95b158cff24ad9985d4fd9 /src/main/java/eu/siacs/conversations/utils
parent632fe1b712f50ee0e1f5ab4754d187ee9aadf2e6 (diff)
parent762820072a4cdc5ee420ac75321b5416d5d31df3 (diff)
Merge remote-tracking branch 'refs/remotes/siacs/master'
Diffstat (limited to 'src/main/java/eu/siacs/conversations/utils')
-rw-r--r--src/main/java/eu/siacs/conversations/utils/XmppUri.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/utils/XmppUri.java b/src/main/java/eu/siacs/conversations/utils/XmppUri.java
index 92c0241e1..3c0136abb 100644
--- a/src/main/java/eu/siacs/conversations/utils/XmppUri.java
+++ b/src/main/java/eu/siacs/conversations/utils/XmppUri.java
@@ -4,6 +4,7 @@ import android.net.Uri;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
+import java.util.List;
import eu.siacs.conversations.xmpp.jid.InvalidJidException;
import eu.siacs.conversations.xmpp.jid.Jid;
@@ -32,8 +33,13 @@ public class XmppUri {
protected void parse(Uri uri) {
String scheme = uri.getScheme();
- if ("xmpp".equalsIgnoreCase(scheme)) {
- // sample: xmpp:jid@foo.com
+ String host = uri.getHost();
+ List<String> segments = uri.getPathSegments();
+ if ("https".equalsIgnoreCase(scheme) && "conversations.im".equalsIgnoreCase(host) && segments.size() >= 3) {
+ // sample : https://conversations.im/i/foo/bar.com
+ jid = segments.get(1)+"@"+segments.get(2);
+ } else if ("xmpp".equalsIgnoreCase(scheme)) {
+ // sample: xmpp:foo@bar.com
muc = "join".equalsIgnoreCase(uri.getQuery());
if (uri.getAuthority() != null) {
jid = uri.getAuthority();
@@ -42,7 +48,7 @@ public class XmppUri {
}
fingerprint = parseFingerprint(uri.getQuery());
} else if ("imto".equalsIgnoreCase(scheme)) {
- // sample: imto://xmpp/jid@foo.com
+ // sample: imto://xmpp/foo@bar.com
try {
jid = URLDecoder.decode(uri.getEncodedPath(), "UTF-8").split("/")[1];
} catch (final UnsupportedEncodingException ignored) {