mirror of
https://github.com/element-hq/element-android
synced 2024-11-23 18:05:36 +03:00
Adds thread notifications and highlights to RoomSummaryEntity
This commit is contained in:
parent
00bfbe9bc6
commit
ebd8461724
2 changed files with 19 additions and 1 deletions
|
@ -115,6 +115,16 @@ internal open class RoomSummaryEntity(
|
||||||
if (value != field) field = value
|
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
|
var readMarkerId: String? = null
|
||||||
set(value) {
|
set(value) {
|
||||||
if (value != field) field = value
|
if (value != field) field = value
|
||||||
|
|
|
@ -113,7 +113,15 @@ internal class RoomSummaryUpdater @Inject constructor(
|
||||||
roomSummaryEntity.highlightCount = unreadNotifications?.highlightCount ?: 0
|
roomSummaryEntity.highlightCount = unreadNotifications?.highlightCount ?: 0
|
||||||
roomSummaryEntity.notificationCount = unreadNotifications?.notificationCount ?: 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) {
|
if (membership != null) {
|
||||||
roomSummaryEntity.membership = membership
|
roomSummaryEntity.membership = membership
|
||||||
|
|
Loading…
Reference in a new issue