From 30f33d36de361f1de587cfd1b1b45857711a2266 Mon Sep 17 00:00:00 2001 From: Florian Renaud Date: Wed, 5 Oct 2022 00:01:04 +0200 Subject: [PATCH] Use session.getRoom(roomId) --- .../voicebroadcast/usecase/PauseVoiceBroadcastUseCase.kt | 3 ++- .../voicebroadcast/usecase/ResumeVoiceBroadcastUseCase.kt | 3 ++- .../voicebroadcast/usecase/StartVoiceBroadcastUseCase.kt | 3 ++- .../voicebroadcast/usecase/StopVoiceBroadcastUseCase.kt | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/voicebroadcast/usecase/PauseVoiceBroadcastUseCase.kt b/vector/src/main/java/im/vector/app/features/voicebroadcast/usecase/PauseVoiceBroadcastUseCase.kt index 9c3fb3a3c3..eaa7392140 100644 --- a/vector/src/main/java/im/vector/app/features/voicebroadcast/usecase/PauseVoiceBroadcastUseCase.kt +++ b/vector/src/main/java/im/vector/app/features/voicebroadcast/usecase/PauseVoiceBroadcastUseCase.kt @@ -23,6 +23,7 @@ import im.vector.app.features.voicebroadcast.model.asVoiceBroadcastEvent import org.matrix.android.sdk.api.query.QueryStringValue import org.matrix.android.sdk.api.session.Session import org.matrix.android.sdk.api.session.events.model.toContent +import org.matrix.android.sdk.api.session.getRoom import org.matrix.android.sdk.api.session.room.Room import org.matrix.android.sdk.api.session.room.model.relation.RelationDefaultContent import timber.log.Timber @@ -33,7 +34,7 @@ class PauseVoiceBroadcastUseCase @Inject constructor( ) { suspend fun execute(roomId: String) { - val room = session.roomService().getRoom(roomId) ?: return + val room = session.getRoom(roomId) ?: return Timber.d("## PauseVoiceBroadcastUseCase: Pause voice broadcast requested") diff --git a/vector/src/main/java/im/vector/app/features/voicebroadcast/usecase/ResumeVoiceBroadcastUseCase.kt b/vector/src/main/java/im/vector/app/features/voicebroadcast/usecase/ResumeVoiceBroadcastUseCase.kt index 67839ccc5f..645496bd7d 100644 --- a/vector/src/main/java/im/vector/app/features/voicebroadcast/usecase/ResumeVoiceBroadcastUseCase.kt +++ b/vector/src/main/java/im/vector/app/features/voicebroadcast/usecase/ResumeVoiceBroadcastUseCase.kt @@ -23,6 +23,7 @@ import im.vector.app.features.voicebroadcast.model.asVoiceBroadcastEvent import org.matrix.android.sdk.api.query.QueryStringValue import org.matrix.android.sdk.api.session.Session import org.matrix.android.sdk.api.session.events.model.toContent +import org.matrix.android.sdk.api.session.getRoom import org.matrix.android.sdk.api.session.room.Room import org.matrix.android.sdk.api.session.room.model.relation.RelationDefaultContent import timber.log.Timber @@ -33,7 +34,7 @@ class ResumeVoiceBroadcastUseCase @Inject constructor( ) { suspend fun execute(roomId: String) { - val room = session.roomService().getRoom(roomId) ?: return + val room = session.getRoom(roomId) ?: return Timber.d("## ResumeVoiceBroadcastUseCase: Resume voice broadcast requested") diff --git a/vector/src/main/java/im/vector/app/features/voicebroadcast/usecase/StartVoiceBroadcastUseCase.kt b/vector/src/main/java/im/vector/app/features/voicebroadcast/usecase/StartVoiceBroadcastUseCase.kt index 2daf1a412d..dd7bb8cdf4 100644 --- a/vector/src/main/java/im/vector/app/features/voicebroadcast/usecase/StartVoiceBroadcastUseCase.kt +++ b/vector/src/main/java/im/vector/app/features/voicebroadcast/usecase/StartVoiceBroadcastUseCase.kt @@ -23,6 +23,7 @@ import im.vector.app.features.voicebroadcast.model.asVoiceBroadcastEvent import org.matrix.android.sdk.api.query.QueryStringValue import org.matrix.android.sdk.api.session.Session import org.matrix.android.sdk.api.session.events.model.toContent +import org.matrix.android.sdk.api.session.getRoom import org.matrix.android.sdk.api.session.room.Room import timber.log.Timber import javax.inject.Inject @@ -32,7 +33,7 @@ class StartVoiceBroadcastUseCase @Inject constructor( ) { suspend fun execute(roomId: String) { - val room = session.roomService().getRoom(roomId) ?: return + val room = session.getRoom(roomId) ?: return Timber.d("## StartVoiceBroadcastUseCase: Start voice broadcast requested") diff --git a/vector/src/main/java/im/vector/app/features/voicebroadcast/usecase/StopVoiceBroadcastUseCase.kt b/vector/src/main/java/im/vector/app/features/voicebroadcast/usecase/StopVoiceBroadcastUseCase.kt index 88a484c5a9..dee822e880 100644 --- a/vector/src/main/java/im/vector/app/features/voicebroadcast/usecase/StopVoiceBroadcastUseCase.kt +++ b/vector/src/main/java/im/vector/app/features/voicebroadcast/usecase/StopVoiceBroadcastUseCase.kt @@ -23,6 +23,7 @@ import im.vector.app.features.voicebroadcast.model.asVoiceBroadcastEvent import org.matrix.android.sdk.api.query.QueryStringValue import org.matrix.android.sdk.api.session.Session import org.matrix.android.sdk.api.session.events.model.toContent +import org.matrix.android.sdk.api.session.getRoom import org.matrix.android.sdk.api.session.room.Room import org.matrix.android.sdk.api.session.room.model.relation.RelationDefaultContent import timber.log.Timber @@ -33,7 +34,7 @@ class StopVoiceBroadcastUseCase @Inject constructor( ) { suspend fun execute(roomId: String) { - val room = session.roomService().getRoom(roomId) ?: return + val room = session.getRoom(roomId) ?: return Timber.d("## StopVoiceBroadcastUseCase: Stop voice broadcast requested")