From 20c896413bf8a6e42262ec98b340dbc84762ac70 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Mon, 13 Aug 2018 15:23:28 -0400 Subject: [PATCH] Stop linkifying addresses. Address linkification on Android is pretty busted, and the docs acknowledge it (see Linkify#MAP_ADDRESSES). Safest thing to do at the moment is remove it. Looks like we may be able to get better address linkification on API >= 28, but adding it will be more involved. Fixes #7730 --- src/org/thoughtcrime/securesms/ConversationItem.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/ConversationItem.java b/src/org/thoughtcrime/securesms/ConversationItem.java index 2d6036110c..6d14193f0e 100644 --- a/src/org/thoughtcrime/securesms/ConversationItem.java +++ b/src/org/thoughtcrime/securesms/ConversationItem.java @@ -569,7 +569,8 @@ public class ConversationItem extends LinearLayout } private SpannableString linkifyMessageBody(SpannableString messageBody, boolean shouldLinkifyAllLinks) { - boolean hasLinks = Linkify.addLinks(messageBody, shouldLinkifyAllLinks ? Linkify.ALL : 0); + int linkPattern = Linkify.WEB_URLS | Linkify.EMAIL_ADDRESSES | Linkify.PHONE_NUMBERS; + boolean hasLinks = Linkify.addLinks(messageBody, shouldLinkifyAllLinks ? linkPattern : 0); if (hasLinks) { URLSpan[] urlSpans = messageBody.getSpans(0, messageBody.length(), URLSpan.class);