diff --git a/vector/src/main/java/im/vector/riotx/features/notifications/BitmapLoader.kt b/vector/src/main/java/im/vector/riotx/features/notifications/BitmapLoader.kt index 51a025e56e..c3a74bd9c3 100644 --- a/vector/src/main/java/im/vector/riotx/features/notifications/BitmapLoader.kt +++ b/vector/src/main/java/im/vector/riotx/features/notifications/BitmapLoader.kt @@ -29,13 +29,10 @@ import javax.inject.Singleton class BitmapLoader @Inject constructor(val context: Context) { /** - * Avatar Url -> Icon + * Avatar Url -> Bitmap */ private val cache = HashMap() - // Black list of URLs (broken URL, etc.) - private val blacklist = HashSet() - /** * Get icon of a room. * If already in cache, use it, else load it and call BitmapLoaderListener.onBitmapsLoaded() when ready @@ -53,7 +50,7 @@ class BitmapLoader @Inject constructor(val context: Context) { @WorkerThread private fun loadRoomBitmap(path: String): Bitmap? { - val bitmap = path.let { + return path.let { try { Glide.with(context) .asBitmap() @@ -66,12 +63,5 @@ class BitmapLoader @Inject constructor(val context: Context) { null } } - - if (bitmap == null) { - // Add to the blacklist - blacklist.add(path) - } - - return bitmap } } diff --git a/vector/src/main/java/im/vector/riotx/features/notifications/IconLoader.kt b/vector/src/main/java/im/vector/riotx/features/notifications/IconLoader.kt index 205f2b0e5b..0c4477f41f 100644 --- a/vector/src/main/java/im/vector/riotx/features/notifications/IconLoader.kt +++ b/vector/src/main/java/im/vector/riotx/features/notifications/IconLoader.kt @@ -31,13 +31,10 @@ import javax.inject.Singleton class IconLoader @Inject constructor(val context: Context) { /** - * Avatar Url -> Icon + * Avatar Url -> IconCompat */ private val cache = HashMap() - // Black list of URLs (broken URL, etc.) - private val blacklist = HashSet() - /** * Get icon of a user. * If already in cache, use it, else load it and call IconLoaderListener.onIconsLoaded() when ready @@ -56,7 +53,7 @@ class IconLoader @Inject constructor(val context: Context) { @WorkerThread private fun loadUserIcon(path: String): IconCompat? { - val iconCompat = path.let { + return path.let { try { Glide.with(context) .asBitmap() @@ -72,12 +69,5 @@ class IconLoader @Inject constructor(val context: Context) { IconCompat.createWithBitmap(bitmap) } } - - if (iconCompat == null) { - // Add to the blacklist - blacklist.add(path) - } - - return iconCompat } }