1
0
Fork 1

show params still for nice xmpp uri (Stephen Paul Weber)

This commit is contained in:
Arne 2023-05-08 18:17:24 +02:00
parent 5444193dee
commit ee7d4f9fa4

View file

@ -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 */ }
}
}
}