Adds thread notifications and highlights to RoomSummaryEntity

This commit is contained in:
ericdecanini 2022-10-07 11:42:18 -04:00
parent 00bfbe9bc6
commit ebd8461724
2 changed files with 19 additions and 1 deletions

View File

@ -115,6 +115,16 @@ internal open class RoomSummaryEntity(
if (value != field) field = value
}
var threadNotificationCount: Int = 0
set(value) {
if (value != field) field = value
}
var threadHighlightCount: Int = 0
set(value) {
if (value != field) field = value
}
var readMarkerId: String? = null
set(value) {
if (value != field) field = value

View File

@ -113,7 +113,15 @@ internal class RoomSummaryUpdater @Inject constructor(
roomSummaryEntity.highlightCount = unreadNotifications?.highlightCount ?: 0
roomSummaryEntity.notificationCount = unreadNotifications?.notificationCount ?: 0
// TODO: Handle unreadThreadNotifications
roomSummaryEntity.threadHighlightCount = unreadThreadNotifications
?.mapNotNull { it.value.highlightCount }
?.sum()
?: 0
roomSummaryEntity.threadNotificationCount = unreadThreadNotifications
?.mapNotNull { it.value.notificationCount }
?.sum()
?: 0
if (membership != null) {
roomSummaryEntity.membership = membership