Mark room as fully read when user goes back to the room list. (#2687)
* Remove not helping warning. * Add and improve tests * Send the `m.fully_read` read marker when the user navigates back to the room list, to mark the room as read.
This commit is contained in:
parent
390e5cf20d
commit
58d503f661
10 changed files with 232 additions and 56 deletions
|
|
@ -54,6 +54,7 @@ class FakeBaseRoom(
|
|||
private val canUserJoinCallResult: (UserId) -> Result<Boolean> = { lambdaError() },
|
||||
private val canUserPinUnpinResult: (UserId) -> Result<Boolean> = { lambdaError() },
|
||||
private val setIsFavoriteResult: (Boolean) -> Result<Unit> = { lambdaError() },
|
||||
private val markAsReadResult: (ReceiptType) -> Result<Unit> = { Result.success(Unit) },
|
||||
private val powerLevelsResult: () -> Result<RoomPowerLevels> = { lambdaError() },
|
||||
private val leaveRoomLambda: () -> Result<Unit> = { lambdaError() },
|
||||
private val updateMembersResult: () -> Unit = { lambdaError() },
|
||||
|
|
@ -183,11 +184,8 @@ class FakeBaseRoom(
|
|||
return setIsFavoriteResult(isFavorite)
|
||||
}
|
||||
|
||||
val markAsReadCalls = mutableListOf<ReceiptType>()
|
||||
|
||||
override suspend fun markAsRead(receiptType: ReceiptType): Result<Unit> {
|
||||
markAsReadCalls.add(receiptType)
|
||||
return Result.success(Unit)
|
||||
return markAsReadResult(receiptType)
|
||||
}
|
||||
|
||||
var setUnreadFlagCalls = mutableListOf<Boolean>()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue