diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/summary/RoomSummaryUpdater.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/summary/RoomSummaryUpdater.kt index a5f69c8a48..68b52bf7f0 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/summary/RoomSummaryUpdater.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/summary/RoomSummaryUpdater.kt @@ -146,16 +146,19 @@ internal class RoomSummaryUpdater @Inject constructor( } roomSummaryEntity.hasUnreadMessages = roomSummaryEntity.notificationCount > 0 || + (roomSummaryEntity.unreadCount?.let { it > 0 } ?: false) || // avoid this call if we are sure there are unread events !isEventRead(realm.configuration, userId, roomId, latestPreviewableEvent?.eventId) roomSummaryEntity.hasUnreadContentMessages = roomSummaryEntity.notificationCount > 0 || + (roomSummaryEntity.unreadCount?.let { it > 0 } ?: false) || // 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 || + (roomSummaryEntity.unreadCount?.let { it > 0 } ?: false) || // avoid this call if we are sure there are unread events (latestPreviewableOriginalContentEvent != null && - !isEventRead(realm.configuration, userId, roomId, latestPreviewableOriginalContentEvent.eventId)) + !isEventRead(realm.configuration, userId, roomId, latestPreviewableOriginalContentEvent.eventId)) roomSummaryEntity.displayName = roomDisplayNameResolver.resolve(realm, roomId) roomSummaryEntity.avatarUrl = roomAvatarResolver.resolve(realm, roomId)