diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/members/moderation/RoomMembersModerationPresenter.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/members/moderation/RoomMembersModerationPresenter.kt index 3a856c4f90..eb23a48bf8 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/members/moderation/RoomMembersModerationPresenter.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/members/moderation/RoomMembersModerationPresenter.kt @@ -22,6 +22,7 @@ import io.element.android.libraries.architecture.Presenter import io.element.android.libraries.architecture.runUpdatingState import io.element.android.libraries.core.coroutine.CoroutineDispatchers import io.element.android.libraries.core.extensions.finally +import io.element.android.libraries.core.meta.BuildMeta import io.element.android.libraries.matrix.api.core.UserId import io.element.android.libraries.matrix.api.room.MatrixRoom import io.element.android.libraries.matrix.api.room.RoomMember @@ -39,13 +40,13 @@ import kotlinx.coroutines.launch import javax.inject.Inject class RoomMembersModerationPresenter @Inject constructor( + private val buildMeta: BuildMeta, private val room: MatrixRoom, private val dispatchers: CoroutineDispatchers, private val analyticsService: AnalyticsService, ) : Presenter { private var selectedMember by mutableStateOf(null) -//isDebugBuild = false, private suspend fun canBan() = room.canBan().getOrDefault(false) private suspend fun canKick() = room.canKick().getOrDefault(false) @@ -134,6 +135,7 @@ class RoomMembersModerationPresenter @Inject constructor( } return RoomMembersModerationState( + isDebugBuild = buildMeta.isDebuggable, canDisplayModerationActions = canDisplayModerationActions, selectedRoomMember = selectedMember, actions = moderationActions, diff --git a/features/roomdetails/impl/src/test/kotlin/io/element/android/features/roomdetails/members/moderation/RoomMembersModerationPresenterTest.kt b/features/roomdetails/impl/src/test/kotlin/io/element/android/features/roomdetails/members/moderation/RoomMembersModerationPresenterTest.kt index 524158a5f3..f23a9b2f4e 100644 --- a/features/roomdetails/impl/src/test/kotlin/io/element/android/features/roomdetails/members/moderation/RoomMembersModerationPresenterTest.kt +++ b/features/roomdetails/impl/src/test/kotlin/io/element/android/features/roomdetails/members/moderation/RoomMembersModerationPresenterTest.kt @@ -319,6 +319,7 @@ class RoomMembersModerationPresenterTest { analyticsService: FakeAnalyticsService = FakeAnalyticsService(), ): RoomMembersModerationPresenter { return RoomMembersModerationPresenter( + buildMeta = buildMeta, room = matrixRoom, dispatchers = dispatchers, analyticsService = analyticsService, diff --git a/samples/minimal/src/main/kotlin/io/element/android/samples/minimal/RoomListScreen.kt b/samples/minimal/src/main/kotlin/io/element/android/samples/minimal/RoomListScreen.kt index 6e46b4e48f..123c62591b 100644 --- a/samples/minimal/src/main/kotlin/io/element/android/samples/minimal/RoomListScreen.kt +++ b/samples/minimal/src/main/kotlin/io/element/android/samples/minimal/RoomListScreen.kt @@ -25,6 +25,7 @@ import io.element.android.features.roomlist.impl.filters.selection.DefaultFilter import io.element.android.features.roomlist.impl.search.RoomListSearchDataSource import io.element.android.features.roomlist.impl.search.RoomListSearchPresenter import io.element.android.libraries.core.coroutine.CoroutineDispatchers +import io.element.android.libraries.core.meta.BuildMeta import io.element.android.libraries.dateformatter.impl.DateFormatters import io.element.android.libraries.dateformatter.impl.DefaultLastMessageTimestampFormatter import io.element.android.libraries.dateformatter.impl.LocalDateTimeProvider @@ -51,12 +52,14 @@ import kotlinx.datetime.Clock import kotlinx.datetime.TimeZone import timber.log.Timber import java.util.Locale +import javax.inject.Inject class RoomListScreen( context: Context, private val matrixClient: MatrixClient, private val coroutineDispatchers: CoroutineDispatchers = Singleton.coroutineDispatchers, ) { + @Inject lateinit var buildMeta: BuildMeta private val clock = Clock.System private val locale = Locale.getDefault() private val timeZone = TimeZone.currentSystemDefault()