mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-28 22:18:46 +03:00
Inline images: use isMxcUrl()
Change-Id: Ie85c5597e714b48dc5bcd3ac69abb5161b4fa640
This commit is contained in:
parent
8158fff0f7
commit
3e2fdd0784
1 changed files with 2 additions and 1 deletions
|
@ -42,6 +42,7 @@ import io.noties.markwon.image.AsyncDrawable
|
|||
import io.noties.markwon.image.glide.GlideImagesPlugin
|
||||
import io.noties.markwon.inlineparser.MarkwonInlineParserPlugin
|
||||
import org.commonmark.node.Node
|
||||
import org.matrix.android.sdk.api.MatrixUrls.isMxcUrl
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
@ -80,7 +81,7 @@ class EventHtmlRenderer @Inject constructor(
|
|||
GlideImagesPlugin.create(object: GlideImagesPlugin.GlideStore {
|
||||
override fun load(drawable: AsyncDrawable): RequestBuilder<Drawable> {
|
||||
val url = drawable.destination
|
||||
if (url.startsWith("mxc://")) {
|
||||
if (url.isMxcUrl()) {
|
||||
val contentUrlResolver = activeSessionHolder.getActiveSession().contentUrlResolver()
|
||||
val imageUrl = contentUrlResolver.resolveFullSize(url)
|
||||
return Glide.with(context).load(imageUrl)
|
||||
|
|
Loading…
Reference in a new issue