From b73bae452a0be27b29848dd087a53f1591c55d97 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Fri, 17 Dec 2021 09:37:50 +0000 Subject: [PATCH] adding comment to explain SpannableStringBuilder usage --- .../home/room/detail/timeline/tools/EventRenderingTools.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/tools/EventRenderingTools.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/tools/EventRenderingTools.kt index 4abaa4fae4..530e8d6a93 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/tools/EventRenderingTools.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/tools/EventRenderingTools.kt @@ -44,7 +44,8 @@ fun CharSequence.findPillsAndProcess(scope: CoroutineScope, processBlock: (PillI } fun CharSequence.linkify(callback: TimelineEventController.UrlClickCallback?): CharSequence { - val text = this.toString() + val text = this.toString() + // SpannableStringBuilder is used to avoid Epoxy throwing ImmutableModelException val spannable = SpannableStringBuilder(this) MatrixLinkify.addLinks(spannable, object : MatrixPermalinkSpan.Callback { override fun onUrlClicked(url: String) {