From 674aea97a8db26f63bf2c72ab68412368e1d6d2e Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Mon, 14 Feb 2022 12:30:47 +0000 Subject: [PATCH] injecting the room name provider as we're within hilts scope --- vector/src/main/java/im/vector/app/core/di/SingletonModule.kt | 4 ++-- .../features/room/VectorRoomDisplayNameFallbackProvider.kt | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/vector/src/main/java/im/vector/app/core/di/SingletonModule.kt b/vector/src/main/java/im/vector/app/core/di/SingletonModule.kt index 2629d2056b..7db88b801b 100644 --- a/vector/src/main/java/im/vector/app/core/di/SingletonModule.kt +++ b/vector/src/main/java/im/vector/app/core/di/SingletonModule.kt @@ -110,10 +110,10 @@ object VectorStaticModule { } @Provides - fun providesMatrixConfiguration(context: Context): MatrixConfiguration { + fun providesMatrixConfiguration(vectorRoomDisplayNameFallbackProvider: VectorRoomDisplayNameFallbackProvider): MatrixConfiguration { return MatrixConfiguration( applicationFlavor = BuildConfig.FLAVOR_DESCRIPTION, - roomDisplayNameFallbackProvider = VectorRoomDisplayNameFallbackProvider(context) + roomDisplayNameFallbackProvider = vectorRoomDisplayNameFallbackProvider ) } diff --git a/vector/src/main/java/im/vector/app/features/room/VectorRoomDisplayNameFallbackProvider.kt b/vector/src/main/java/im/vector/app/features/room/VectorRoomDisplayNameFallbackProvider.kt index 33e63434ce..0be2a21ef4 100644 --- a/vector/src/main/java/im/vector/app/features/room/VectorRoomDisplayNameFallbackProvider.kt +++ b/vector/src/main/java/im/vector/app/features/room/VectorRoomDisplayNameFallbackProvider.kt @@ -19,8 +19,9 @@ package im.vector.app.features.room import android.content.Context import im.vector.app.R import org.matrix.android.sdk.api.RoomDisplayNameFallbackProvider +import javax.inject.Inject -class VectorRoomDisplayNameFallbackProvider( +class VectorRoomDisplayNameFallbackProvider @Inject constructor( private val context: Context ) : RoomDisplayNameFallbackProvider {