Set a default power level to join calls in room (#1927)

* Set a default power level to join calls.

Also, create new rooms taking this power level into account.

* Modify test to make sure we display the disabled state even when there is an ongoing call

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This commit is contained in:
Jorge Martin Espinosa 2023-11-30 10:47:48 +01:00 committed by GitHub
parent 7582d2f12e
commit 2e8d5ac86a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 98 additions and 21 deletions

View file

@ -111,6 +111,7 @@ class FakeMatrixRoom(
private var generateWidgetWebViewUrlResult = Result.success("https://call.element.io")
private var getWidgetDriverResult: Result<MatrixWidgetDriver> = Result.success(FakeWidgetDriver())
private var canUserTriggerRoomNotificationResult: Result<Boolean> = Result.success(true)
private var canUserJoinCallResult: Result<Boolean> = Result.success(true)
var sendMessageMentions = emptyList<Mention>()
val editMessageCalls = mutableListOf<Pair<String, String?>>()
@ -292,6 +293,10 @@ class FakeMatrixRoom(
return canUserTriggerRoomNotificationResult
}
override suspend fun canUserJoinCall(userId: UserId): Result<Boolean> {
return canUserJoinCallResult
}
override suspend fun sendImage(
file: File,
thumbnailFile: File,
@ -474,6 +479,10 @@ class FakeMatrixRoom(
canUserTriggerRoomNotificationResult = result
}
fun givenCanUserJoinCall(result: Result<Boolean>) {
canUserJoinCallResult = result
}
fun givenIgnoreResult(result: Result<Unit>) {
ignoreResult = result
}