From 10f7673be7cc1871d69dd1e73f14a8f8afe6f46c Mon Sep 17 00:00:00 2001 From: NIkita Fedrunov Date: Wed, 2 Feb 2022 15:53:20 +0100 Subject: [PATCH] removed obsolete room list filter class --- .../room/list/RoomListDisplayModeFilter.kt | 38 ------------------- 1 file changed, 38 deletions(-) delete mode 100644 vector/src/main/java/im/vector/app/features/home/room/list/RoomListDisplayModeFilter.kt diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/RoomListDisplayModeFilter.kt b/vector/src/main/java/im/vector/app/features/home/room/list/RoomListDisplayModeFilter.kt deleted file mode 100644 index 94a79f5fbd..0000000000 --- a/vector/src/main/java/im/vector/app/features/home/room/list/RoomListDisplayModeFilter.kt +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2019 New Vector Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package im.vector.app.features.home.room.list - -import androidx.core.util.Predicate -import im.vector.app.features.home.RoomListDisplayMode -import org.matrix.android.sdk.api.session.room.model.Membership -import org.matrix.android.sdk.api.session.room.model.RoomSummary - -class RoomListDisplayModeFilter(private val displayMode: RoomListDisplayMode) : Predicate { - - override fun test(roomSummary: RoomSummary): Boolean { - if (roomSummary.membership.isLeft()) { - return false - } - return when (displayMode) { - RoomListDisplayMode.NOTIFICATIONS -> - roomSummary.notificationCount > 0 || roomSummary.membership == Membership.INVITE || roomSummary.userDrafts.isNotEmpty() - RoomListDisplayMode.PEOPLE -> roomSummary.isDirect && roomSummary.membership.isActive() - RoomListDisplayMode.ROOMS -> !roomSummary.isDirect && roomSummary.membership.isActive() - RoomListDisplayMode.FILTERED -> roomSummary.membership == Membership.JOIN - } - } -}