Ensure proper grouping for notifications tab query

Change-Id: I58e8a85fd5e2c938d55189825daf7820f826da1e
This commit is contained in:
SpiritCroc 2021-05-05 12:31:20 +02:00
parent ca21a3fc43
commit 709f8b0b05

View file

@ -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
}