Rework some MatrixRoom api and fix rust 'destroyed' crash

This commit is contained in:
ganfra 2023-07-25 12:06:36 +02:00
parent 0ef49ca6ca
commit daf23c5541
6 changed files with 76 additions and 71 deletions

View file

@ -100,7 +100,6 @@ class FakeMatrixRoom(
private val _sentLocations = mutableListOf<SendLocationInvocation>()
val sentLocations: List<SendLocationInvocation> = _sentLocations
var invitedUserId: UserId? = null
private set
@ -128,9 +127,11 @@ class FakeMatrixRoom(
override val timeline: MatrixTimeline = matrixTimeline
override fun open(): Result<Unit> {
return Result.success(Unit)
}
override fun subscribeToSync() = Unit
override fun unsubscribeFromSync() = Unit
override fun destroy() = Unit
override suspend fun userDisplayName(userId: UserId): Result<String?> = simulateLongTask {
userDisplayNameResult
@ -283,8 +284,6 @@ class FakeMatrixRoom(
return sendLocationResult
}
override fun close() = Unit
fun givenLeaveRoomError(throwable: Throwable?) {
this.leaveRoomError = throwable
}