Fix API break: use new methods canUserRedactOwn and canUserRedactOther.
This commit is contained in:
parent
ce7d77059c
commit
f844399025
13 changed files with 286 additions and 49 deletions
|
|
@ -78,7 +78,8 @@ class FakeMatrixRoom(
|
|||
override val activeMemberCount: Long = 234L,
|
||||
val notificationSettingsService: NotificationSettingsService = FakeNotificationSettingsService(),
|
||||
private val matrixTimeline: MatrixTimeline = FakeMatrixTimeline(),
|
||||
canRedact: Boolean = false,
|
||||
canRedactOwn: Boolean = false,
|
||||
canRedactOther: Boolean = false,
|
||||
) : MatrixRoom {
|
||||
private var ignoreResult: Result<Unit> = Result.success(Unit)
|
||||
private var unignoreResult: Result<Unit> = Result.success(Unit)
|
||||
|
|
@ -88,7 +89,8 @@ class FakeMatrixRoom(
|
|||
private var joinRoomResult = Result.success(Unit)
|
||||
private var inviteUserResult = Result.success(Unit)
|
||||
private var canInviteResult = Result.success(true)
|
||||
private var canRedactResult = Result.success(canRedact)
|
||||
private var canRedactOwnResult = Result.success(canRedactOwn)
|
||||
private var canRedactOtherResult = Result.success(canRedactOther)
|
||||
private val canSendStateResults = mutableMapOf<StateEventType, Result<Boolean>>()
|
||||
private val canSendEventResults = mutableMapOf<MessageEventType, Result<Boolean>>()
|
||||
private var sendMediaResult = Result.success(FakeMediaUploadHandler())
|
||||
|
|
@ -276,8 +278,12 @@ class FakeMatrixRoom(
|
|||
return canInviteResult
|
||||
}
|
||||
|
||||
override suspend fun canUserRedact(userId: UserId): Result<Boolean> {
|
||||
return canRedactResult
|
||||
override suspend fun canUserRedactOwn(userId: UserId): Result<Boolean> {
|
||||
return canRedactOwnResult
|
||||
}
|
||||
|
||||
override suspend fun canUserRedactOther(userId: UserId): Result<Boolean> {
|
||||
return canRedactOtherResult
|
||||
}
|
||||
|
||||
override suspend fun canUserSendState(userId: UserId, type: StateEventType): Result<Boolean> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue