From a4ea9a09ad2fe44bc6f867d939d060be9a4fa44e Mon Sep 17 00:00:00 2001 From: ganfra Date: Thu, 19 Dec 2019 13:41:57 +0100 Subject: [PATCH] Room factory: add scope to avoid recreate all the dependencies --- .../vector/matrix/android/internal/session/room/RoomFactory.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/RoomFactory.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/RoomFactory.kt index 30a2948f68..a21a3b4a8d 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/RoomFactory.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/RoomFactory.kt @@ -20,6 +20,7 @@ import com.zhuinden.monarchy.Monarchy import im.vector.matrix.android.api.session.crypto.CryptoService import im.vector.matrix.android.api.session.room.Room import im.vector.matrix.android.internal.database.mapper.RoomSummaryMapper +import im.vector.matrix.android.internal.session.SessionScope import im.vector.matrix.android.internal.session.room.draft.DefaultDraftService import im.vector.matrix.android.internal.session.room.membership.DefaultMembershipService import im.vector.matrix.android.internal.session.room.notification.DefaultRoomPushRuleService @@ -35,6 +36,7 @@ internal interface RoomFactory { fun create(roomId: String): Room } +@SessionScope internal class DefaultRoomFactory @Inject constructor(private val monarchy: Monarchy, private val roomSummaryMapper: RoomSummaryMapper, private val cryptoService: CryptoService,