mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Consider the returned value of LinkifyCompat.addLinks
This commit is contained in:
committed by
Benoit Marty
parent
74729fe534
commit
d800b225b6
+2
-5
@@ -244,9 +244,6 @@ class TimelineItemContentMessageFactory @Inject constructor(
|
|||||||
|
|
||||||
private fun String.withLinks(): CharSequence? {
|
private fun String.withLinks(): CharSequence? {
|
||||||
val spannable = toSpannable()
|
val spannable = toSpannable()
|
||||||
LinkifyCompat.addLinks(spannable, Linkify.WEB_URLS or Linkify.PHONE_NUMBERS)
|
val addedLinks = LinkifyCompat.addLinks(spannable, Linkify.WEB_URLS or Linkify.PHONE_NUMBERS)
|
||||||
if (spannable.getSpans<URLSpan>().isEmpty()) {
|
return spannable.takeIf { addedLinks }
|
||||||
return null
|
|
||||||
}
|
|
||||||
return spannable
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user