feat: add support for unread message and room highlighting (#49)

Reviewed-on: https://git.reya.su/reya/coop-mobile/pulls/49
This commit is contained in:
2026-07-21 03:44:53 +00:00
parent 4a8134dec0
commit a124dc4cc4
4 changed files with 86 additions and 26 deletions
@@ -42,6 +42,8 @@ class ChatScreenViewModel(
messages.clear()
messages.addAll(initialMessages.distinctBy { it.id() })
loading = false
// Mark the room as read once messages are loaded
chatRepository.markAsRead(id)
}
}
@@ -55,6 +57,7 @@ class ChatScreenViewModel(
if (event.roomId() == id) {
if (messages.none { it.id() == event.id() }) {
messages.add(0, event)
chatRepository.markAsRead(id)
}
} else {
newOtherMessages++