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:
Benoit Marty 2025-06-04 16:14:29 +02:00 committed by GitHub
parent 390e5cf20d
commit 58d503f661
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 232 additions and 56 deletions

View file

@ -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>()