diff --git a/vector/src/main/java/im/vector/riotx/features/media/ImageContentRenderer.kt b/vector/src/main/java/im/vector/riotx/features/media/ImageContentRenderer.kt index 3f0daebdbe..6f34001124 100644 --- a/vector/src/main/java/im/vector/riotx/features/media/ImageContentRenderer.kt +++ b/vector/src/main/java/im/vector/riotx/features/media/ImageContentRenderer.kt @@ -127,23 +127,18 @@ class ImageContentRenderer @Inject constructor(private val activeSessionHolder: GlideApp .with(imageView) .load(resolvedUrl) - .listener(object : RequestListener { - override fun onResourceReady(resource: Drawable?, model: Any?, target: Target?, dataSource: DataSource?, isFirstResource: Boolean): Boolean { - return false - } - - override fun onLoadFailed(e: GlideException?, model: Any?, target: Target?, isFirstResource: Boolean): Boolean { - data.url - ?.takeIf { it != resolvedUrl } - ?.let { - GlideApp - .with(imageView) - .load(it) - return false - } - return true - } - }) + .apply { + contentUrlResolver + .resolveFullSize(data.url) + ?.takeIf { it != resolvedUrl } + ?.let { fullSizeUrl -> + error( + GlideApp + .with(imageView) + .load(fullSizeUrl) + ) + } + } } }