show params still for nice xmpp uri (Stephen Paul Weber)
This commit is contained in:
parent
5444193dee
commit
ee7d4f9fa4
1 changed files with 6 additions and 6 deletions
|
@ -397,12 +397,12 @@ public class MyLinkify {
|
|||
for (final URLSpan urlspan : body.getSpans(0, body.length() - 1, URLSpan.class)) {
|
||||
Uri uri = Uri.parse(urlspan.getURL());
|
||||
if ("xmpp".equals(uri.getScheme())) {
|
||||
if (!body.subSequence(body.getSpanStart(urlspan), body.getSpanEnd(urlspan)).toString().startsWith("xmpp:")) {
|
||||
// Already customized
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
if (!body.subSequence(body.getSpanStart(urlspan), body.getSpanEnd(urlspan)).toString().startsWith("xmpp:")) {
|
||||
// Already customized
|
||||
continue;
|
||||
}
|
||||
|
||||
XmppUri xmppUri = new XmppUri(uri);
|
||||
Jid jid = xmppUri.getJid();
|
||||
String display = xmppUri.toString();
|
||||
|
@ -420,7 +420,7 @@ public class MyLinkify {
|
|||
body.getSpanEnd(urlspan),
|
||||
display
|
||||
);
|
||||
} catch (final IllegalArgumentException e) { /* bad JID */ }
|
||||
} catch (final IllegalArgumentException | IndexOutOfBoundsException e) { /* bad JID or span gone */ }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue