Display banned users in room member list (#2415)

* Display banned users in room member list

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This commit is contained in:
Jorge Martin Espinosa 2024-02-20 10:07:06 +01:00 committed by GitHub
parent 9669f84766
commit e68139bf46
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 197 additions and 31 deletions

View file

@ -90,6 +90,7 @@ class FakeMatrixRoom(
private var joinRoomResult = Result.success(Unit)
private var inviteUserResult = Result.success(Unit)
private var canInviteResult = Result.success(true)
private var canBanResult = Result.success(false)
private var canRedactOwnResult = Result.success(canRedactOwn)
private var canRedactOtherResult = Result.success(canRedactOther)
private val canSendStateResults = mutableMapOf<StateEventType, Result<Boolean>>()
@ -280,6 +281,10 @@ class FakeMatrixRoom(
inviteUserResult
}
override suspend fun canUserBan(userId: UserId): Result<Boolean> {
return canBanResult
}
override suspend fun canUserInvite(userId: UserId): Result<Boolean> {
return canInviteResult
}
@ -495,6 +500,10 @@ class FakeMatrixRoom(
joinRoomResult = result
}
fun givenCanBanResult(result: Result<Boolean>) {
canBanResult = result
}
fun givenInviteUserResult(result: Result<Unit>) {
inviteUserResult = result
}