Merge pull request #6136 from element-hq/feature/fga/space_room_list_filter
Add Space Filters feature for Room List
This commit is contained in:
commit
6327641469
75 changed files with 1329 additions and 182 deletions
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
package io.element.android.libraries.matrix.api.roomlist
|
||||
|
||||
import io.element.android.libraries.matrix.api.core.RoomId
|
||||
|
||||
sealed interface RoomListFilter {
|
||||
companion object {
|
||||
/**
|
||||
|
|
@ -41,6 +43,10 @@ sealed interface RoomListFilter {
|
|||
val filters: List<RoomListFilter>
|
||||
) : RoomListFilter
|
||||
|
||||
data class Identifiers(
|
||||
val values: List<RoomId>,
|
||||
) : RoomListFilter
|
||||
|
||||
/**
|
||||
* A filter that matches rooms that are unread.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -12,9 +12,8 @@ import io.element.android.libraries.matrix.api.core.RoomId
|
|||
import kotlinx.coroutines.flow.SharedFlow
|
||||
|
||||
interface SpaceService {
|
||||
val spaceRoomsFlow: SharedFlow<List<SpaceRoom>>
|
||||
suspend fun joinedSpaces(): Result<List<SpaceRoom>>
|
||||
|
||||
val topLevelSpacesFlow: SharedFlow<List<SpaceRoom>>
|
||||
val spaceFiltersFlow: SharedFlow<List<SpaceServiceFilter>>
|
||||
suspend fun joinedParents(spaceId: RoomId): Result<List<SpaceRoom>>
|
||||
|
||||
suspend fun getSpaceRoom(spaceId: RoomId): SpaceRoom?
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* Copyright (c) 2025 Element Creations Ltd.
|
||||
* Copyright 2025 New Vector Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.libraries.matrix.api.spaces
|
||||
|
||||
import io.element.android.libraries.matrix.api.core.RoomId
|
||||
|
||||
/**
|
||||
* Represents a space filter for filtering rooms by space membership.
|
||||
*
|
||||
* @property spaceRoom The space room associated with this filter.
|
||||
* @property level The nesting level of the space (0 = top level, 1 = first level child, etc.).
|
||||
* @property descendants The list of room IDs that are descendants of this space.
|
||||
*/
|
||||
data class SpaceServiceFilter(
|
||||
val spaceRoom: SpaceRoom,
|
||||
val level: Int,
|
||||
val descendants: List<RoomId>,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue