From 709f8b0b05fb65c61548d27b4d505b21a0c22531 Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Wed, 5 May 2021 12:31:20 +0200 Subject: [PATCH] Ensure proper grouping for notifications tab query Change-Id: I58e8a85fd5e2c938d55189825daf7820f826da1e --- .../internal/session/room/summary/RoomSummaryDataSource.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/summary/RoomSummaryDataSource.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/summary/RoomSummaryDataSource.kt index 6fce67d2ba..c3e66cd7b4 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/summary/RoomSummaryDataSource.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/summary/RoomSummaryDataSource.kt @@ -178,7 +178,9 @@ internal class RoomSummaryDataSource @Inject constructor(@SessionDatabase privat when (it) { RoomCategoryFilter.ONLY_DM -> query.equalTo(RoomSummaryEntityFields.IS_DIRECT, true) RoomCategoryFilter.ONLY_ROOMS -> query.equalTo(RoomSummaryEntityFields.IS_DIRECT, false) - RoomCategoryFilter.ONLY_WITH_NOTIFICATIONS -> query.greaterThan(RoomSummaryEntityFields.NOTIFICATION_COUNT, 0).or().equalTo(RoomSummaryEntityFields.MARKED_UNREAD, true) + RoomCategoryFilter.ONLY_WITH_NOTIFICATIONS -> query.beginGroup() + .greaterThan(RoomSummaryEntityFields.NOTIFICATION_COUNT, 0).or() + .equalTo(RoomSummaryEntityFields.MARKED_UNREAD, true).endGroup() RoomCategoryFilter.ALL -> { // nop }