Merge pull request #2293 from element-hq/feature/bma/notificationCount

Iterate on notification badges
This commit is contained in:
Benoit Marty 2024-01-30 10:33:17 +01:00 committed by GitHub
commit a7541be6bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
48 changed files with 138 additions and 150 deletions

View file

@ -42,6 +42,7 @@ data class RoomSummaryDetails(
val lastMessage: RoomMessage?,
val numUnreadMessages: Int,
val numUnreadMentions: Int,
val numUnreadNotifications: Int,
val inviter: RoomMember?,
val userDefinedNotificationMode: RoomNotificationMode?,
val hasRoomCall: Boolean,

View file

@ -37,6 +37,7 @@ class RoomSummaryDetailsFactory(private val roomMessageFactory: RoomMessageFacto
avatarUrl = roomInfo.avatarUrl,
numUnreadMentions = roomInfo.numUnreadMentions.toInt(),
numUnreadMessages = roomInfo.numUnreadMessages.toInt(),
numUnreadNotifications = roomInfo.numUnreadNotifications.toInt(),
lastMessage = latestRoomMessage,
inviter = roomInfo.inviter?.let(RoomMemberMapper::map),
userDefinedNotificationMode = roomInfo.userDefinedNotificationMode?.let(RoomNotificationSettingsMapper::mapMode),

View file

@ -61,6 +61,7 @@ fun aRoomSummaryDetails(
lastMessage: RoomMessage? = aRoomMessage(),
numUnreadMentions: Int = 0,
numUnreadMessages: Int = 0,
numUnreadNotifications: Int = 0,
notificationMode: RoomNotificationMode? = null,
inviter: RoomMember? = null,
canonicalAlias: String? = null,
@ -74,6 +75,7 @@ fun aRoomSummaryDetails(
lastMessage = lastMessage,
numUnreadMentions = numUnreadMentions,
numUnreadMessages = numUnreadMessages,
numUnreadNotifications = numUnreadNotifications,
userDefinedNotificationMode = notificationMode,
inviter = inviter,
canonicalAlias = canonicalAlias,

View file

@ -115,6 +115,7 @@ fun aRoomSummaryDetails(
isDm: Boolean = false,
numUnreadMentions: Int = 0,
numUnreadMessages: Int = 0,
numUnreadNotifications: Int = 0,
) = RoomSummaryDetails(
roomId = roomId,
name = name,
@ -128,4 +129,5 @@ fun aRoomSummaryDetails(
isDm = isDm,
numUnreadMentions = numUnreadMentions,
numUnreadMessages = numUnreadMessages,
numUnreadNotifications = numUnreadNotifications,
)