Merge pull request #4718 from element-hq/feature/fga/report_room_enabled_flow

Change (report room) : check if server supports the report room api
This commit is contained in:
ganfra 2025-05-14 17:25:17 +02:00 committed by GitHub
commit 49b885579f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 25 additions and 9 deletions

View file

@ -88,6 +88,7 @@ class FakeMatrixClient(
private val availableSlidingSyncVersionsLambda: () -> Result<List<SlidingSyncVersion>> = { lambdaError() },
private val ignoreUserResult: (UserId) -> Result<Unit> = { lambdaError() },
private var unIgnoreUserResult: (UserId) -> Result<Unit> = { Result.success(Unit) },
private val canReportRoomLambda: () -> Boolean = { false },
override val ignoredUsersFlow: StateFlow<ImmutableList<UserId>> = MutableStateFlow(persistentListOf()),
) : MatrixClient {
var setDisplayNameCalled: Boolean = false
@ -329,4 +330,8 @@ class FakeMatrixClient(
override suspend fun availableSlidingSyncVersions(): Result<List<SlidingSyncVersion>> {
return availableSlidingSyncVersionsLambda()
}
override suspend fun canReportRoom(): Boolean {
return canReportRoomLambda()
}
}