mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-17 04:20:00 +03:00
Restore old hasUnread detection algorithm to include notices
Change-Id: Ib934a381cad1fec18815e222d61350240ba9d93f
This commit is contained in:
parent
3563e76432
commit
45c6a4e9ba
1 changed files with 7 additions and 9 deletions
|
@ -137,18 +137,16 @@ internal class RoomSummaryUpdater @Inject constructor(
|
|||
roomSummaryEntity.lastActivityTime = lastActivityFromEvent
|
||||
}
|
||||
|
||||
// If unreadCount == null, the server likely just doesn't support MSC 2654, so we need to check manually either way
|
||||
val hasUnreadEvents = unreadCount == null || unreadCount > 0
|
||||
roomSummaryEntity.hasUnreadMessages = roomSummaryEntity.notificationCount > 0
|
||||
// avoid this call if we are sure there are (no) unread events
|
||||
|| (hasUnreadEvents && !isEventRead(realm.configuration, userId, roomId, latestPreviewableEvent?.eventId))
|
||||
// avoid this call if we are sure there are unread events
|
||||
|| !isEventRead(realm.configuration, userId, roomId, latestPreviewableEvent?.eventId)
|
||||
roomSummaryEntity.hasUnreadContentMessages = roomSummaryEntity.notificationCount > 0
|
||||
// avoid this call if we are sure there are (no) unread events
|
||||
|| (hasUnreadEvents && latestPreviewableContentEvent != null
|
||||
&& !isEventRead(realm.configuration, userId, roomId, latestPreviewableContentEvent.eventId))
|
||||
// avoid this call if we are sure there are unread events
|
||||
|| (latestPreviewableContentEvent != null
|
||||
&& !isEventRead(realm.configuration, userId, roomId, latestPreviewableContentEvent.eventId))
|
||||
roomSummaryEntity.hasUnreadOriginalContentMessages = roomSummaryEntity.notificationCount > 0
|
||||
// avoid this call if we are sure there are (no) unread events
|
||||
|| (hasUnreadEvents && latestPreviewableOriginalContentEvent != null
|
||||
// avoid this call if we are sure there are unread events
|
||||
|| (latestPreviewableOriginalContentEvent != null
|
||||
&& !isEventRead(realm.configuration, userId, roomId, latestPreviewableOriginalContentEvent.eventId))
|
||||
|
||||
roomSummaryEntity.displayName = roomDisplayNameResolver.resolve(realm, roomId)
|
||||
|
|
Loading…
Add table
Reference in a new issue