feat: Add "Mark all as read" and unread message count indicators (#4720)

This commit is contained in:
James Rich 2026-03-05 12:18:34 -06:00 committed by GitHub
parent 6a1a612c38
commit b0258d0cf1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 131 additions and 26 deletions

View file

@ -77,6 +77,9 @@ constructor(
override suspend fun getUnreadCount(contact: String): Int =
withContext(dispatchers.io) { dbManager.currentDb.value.packetDao().getUnreadCount(contact) }
override fun getUnreadCountFlow(contact: String): Flow<Int> =
dbManager.currentDb.flatMapLatest { db -> db.packetDao().getUnreadCountFlow(contact) }
override fun getFirstUnreadMessageUuid(contact: String): Flow<Long?> =
dbManager.currentDb.flatMapLatest { db -> db.packetDao().getFirstUnreadMessageUuid(contact) }
@ -89,6 +92,9 @@ constructor(
override suspend fun clearUnreadCount(contact: String, timestamp: Long) =
withContext(dispatchers.io) { dbManager.currentDb.value.packetDao().clearUnreadCount(contact, timestamp) }
override suspend fun clearAllUnreadCounts() =
withContext(dispatchers.io) { dbManager.currentDb.value.packetDao().clearAllUnreadCounts() }
override suspend fun updateLastReadMessage(contact: String, messageUuid: Long, lastReadTimestamp: Long) =
withContext(dispatchers.io) {
val dao = dbManager.currentDb.value.packetDao()