From 818f32ffb52be8dd8f10698ab0966dc3c078d04d Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 31 Dec 2022 15:10:11 +0100 Subject: [PATCH] some fixes --- .../main/java/app/fedilab/android/helper/SpannableHelper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/helper/SpannableHelper.java b/app/src/main/java/app/fedilab/android/helper/SpannableHelper.java index 4dc194443..2e3ba27a1 100644 --- a/app/src/main/java/app/fedilab/android/helper/SpannableHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/SpannableHelper.java @@ -124,7 +124,7 @@ public class SpannableHelper { linkColor = -1; } List mentions = new ArrayList<>(); - if (status != null) { + if (status != null && status.mentions != null) { mentions.addAll(status.mentions); } text = text.replaceAll("((<\\s?p\\s?>|<\\s?br\\s?/?>)>(((?!([<])).)*))", "$2
$3
"); @@ -437,7 +437,7 @@ public class SpannableHelper { textView.setTag(CLICKABLE_SPAN); Pattern link = Pattern.compile("https?://([\\da-z.-]+\\.[a-z.]{2,10})/(@[\\w._-]*[0-9]*)(/[0-9]+)?$"); - Matcher matcherLink = link.matcher(content); + Matcher matcherLink = link.matcher(finalUrl); if (matcherLink.find() && !finalUrl.contains("medium.com")) { if (matcherLink.group(3) != null && Objects.requireNonNull(matcherLink.group(3)).length() > 0) { //It's a toot CrossActionHelper.fetchRemoteStatus(context, currentAccount, finalUrl, new CrossActionHelper.Callback() {