Fix crash ImmutableModelException

This commit is contained in:
ariskotsomitopoulos 2021-12-16 20:14:21 +02:00
parent 3b35be510f
commit 2275bdd4fa

View file

@ -16,6 +16,7 @@
package im.vector.app.features.home.room.detail.timeline.tools package im.vector.app.features.home.room.detail.timeline.tools
import android.text.SpannableStringBuilder
import android.text.style.ClickableSpan import android.text.style.ClickableSpan
import android.view.MotionEvent import android.view.MotionEvent
import android.widget.TextView import android.widget.TextView
@ -44,7 +45,7 @@ fun CharSequence.findPillsAndProcess(scope: CoroutineScope, processBlock: (PillI
fun CharSequence.linkify(callback: TimelineEventController.UrlClickCallback?): CharSequence { fun CharSequence.linkify(callback: TimelineEventController.UrlClickCallback?): CharSequence {
val text = this.toString() val text = this.toString()
val spannable = toSpannable() val spannable = SpannableStringBuilder(this)
MatrixLinkify.addLinks(spannable, object : MatrixPermalinkSpan.Callback { MatrixLinkify.addLinks(spannable, object : MatrixPermalinkSpan.Callback {
override fun onUrlClicked(url: String) { override fun onUrlClicked(url: String) {
callback?.onUrlClicked(url, text) callback?.onUrlClicked(url, text)