read : use the new apis

This commit is contained in:
ganfra
2024-02-14 11:09:46 +01:00
parent 9100cc81ea
commit 7e0e0f9ec4
7 changed files with 45 additions and 36 deletions

View File

@@ -442,19 +442,15 @@ class RustMatrixRoom(
}
}
override suspend fun markAsRead(receiptType: ReceiptType?): Result<Unit> = withContext(roomDispatcher) {
override suspend fun markAsRead(receiptType: ReceiptType): Result<Unit> = withContext(roomDispatcher) {
runCatching {
if (receiptType != null) {
innerRoom.markAsReadAndSendReadReceipt(receiptType.toRustReceiptType())
} else {
innerRoom.markAsRead()
}
innerRoom.markAsRead(receiptType.toRustReceiptType())
}
}
override suspend fun markAsUnread(): Result<Unit> = withContext(roomDispatcher) {
override suspend fun setUnreadFlag(isUnread: Boolean): Result<Unit> = withContext(roomDispatcher) {
runCatching {
innerRoom.markAsUnread()
innerRoom.setUnreadFlag(isUnread)
}
}