mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 02:15:35 +03:00
Rename ActiveSpaceFilter to SpaceFilter
This commit is contained in:
parent
00809027c1
commit
c7997edf9a
11 changed files with 45 additions and 45 deletions
|
@ -29,8 +29,8 @@ import org.junit.runner.RunWith
|
||||||
import org.junit.runners.JUnit4
|
import org.junit.runners.JUnit4
|
||||||
import org.junit.runners.MethodSorters
|
import org.junit.runners.MethodSorters
|
||||||
import org.matrix.android.sdk.InstrumentedTest
|
import org.matrix.android.sdk.InstrumentedTest
|
||||||
import org.matrix.android.sdk.api.query.ActiveSpaceFilter
|
|
||||||
import org.matrix.android.sdk.api.query.QueryStringValue
|
import org.matrix.android.sdk.api.query.QueryStringValue
|
||||||
|
import org.matrix.android.sdk.api.query.SpaceFilter
|
||||||
import org.matrix.android.sdk.api.session.Session
|
import org.matrix.android.sdk.api.session.Session
|
||||||
import org.matrix.android.sdk.api.session.events.model.EventType
|
import org.matrix.android.sdk.api.session.events.model.EventType
|
||||||
import org.matrix.android.sdk.api.session.events.model.toContent
|
import org.matrix.android.sdk.api.session.events.model.toContent
|
||||||
|
@ -248,7 +248,7 @@ class SpaceHierarchyTest : InstrumentedTest {
|
||||||
|
|
||||||
Thread.sleep(6_000)
|
Thread.sleep(6_000)
|
||||||
val orphansUpdate = session.roomService().getRoomSummaries(roomSummaryQueryParams {
|
val orphansUpdate = session.roomService().getRoomSummaries(roomSummaryQueryParams {
|
||||||
activeSpaceFilter = ActiveSpaceFilter.ActiveSpace(null)
|
spaceFilter = SpaceFilter.ActiveSpace(null)
|
||||||
})
|
})
|
||||||
assertEquals("Unexpected number of orphan rooms ${orphansUpdate.map { it.name }}", 2, orphansUpdate.size)
|
assertEquals("Unexpected number of orphan rooms ${orphansUpdate.map { it.name }}", 2, orphansUpdate.size)
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ package org.matrix.android.sdk.api.query
|
||||||
* Filter to be used to do room queries.
|
* Filter to be used to do room queries.
|
||||||
* @see [org.matrix.android.sdk.api.session.room.RoomSummaryQueryParams]
|
* @see [org.matrix.android.sdk.api.session.room.RoomSummaryQueryParams]
|
||||||
*/
|
*/
|
||||||
sealed class ActiveSpaceFilter {
|
sealed class SpaceFilter {
|
||||||
data class ActiveSpace(val currentSpaceId: String?) : ActiveSpaceFilter()
|
data class ActiveSpace(val currentSpaceId: String?) : SpaceFilter()
|
||||||
data class ExcludeSpace(val spaceId: String) : ActiveSpaceFilter()
|
data class ExcludeSpace(val spaceId: String) : SpaceFilter()
|
||||||
}
|
}
|
|
@ -16,10 +16,10 @@
|
||||||
|
|
||||||
package org.matrix.android.sdk.api.session.room
|
package org.matrix.android.sdk.api.session.room
|
||||||
|
|
||||||
import org.matrix.android.sdk.api.query.ActiveSpaceFilter
|
|
||||||
import org.matrix.android.sdk.api.query.QueryStringValue
|
import org.matrix.android.sdk.api.query.QueryStringValue
|
||||||
import org.matrix.android.sdk.api.query.RoomCategoryFilter
|
import org.matrix.android.sdk.api.query.RoomCategoryFilter
|
||||||
import org.matrix.android.sdk.api.query.RoomTagQueryFilter
|
import org.matrix.android.sdk.api.query.RoomTagQueryFilter
|
||||||
|
import org.matrix.android.sdk.api.query.SpaceFilter
|
||||||
import org.matrix.android.sdk.api.session.room.model.Membership
|
import org.matrix.android.sdk.api.session.room.model.Membership
|
||||||
import org.matrix.android.sdk.api.session.room.model.RoomType
|
import org.matrix.android.sdk.api.session.room.model.RoomType
|
||||||
import org.matrix.android.sdk.api.session.space.SpaceSummaryQueryParams
|
import org.matrix.android.sdk.api.session.space.SpaceSummaryQueryParams
|
||||||
|
@ -86,7 +86,7 @@ data class RoomSummaryQueryParams(
|
||||||
/**
|
/**
|
||||||
* Used to filter room using the current space.
|
* Used to filter room using the current space.
|
||||||
*/
|
*/
|
||||||
val activeSpaceFilter: ActiveSpaceFilter?,
|
val spaceFilter: SpaceFilter?,
|
||||||
/**
|
/**
|
||||||
* Used to filter room using the current group.
|
* Used to filter room using the current group.
|
||||||
*/
|
*/
|
||||||
|
@ -101,7 +101,7 @@ data class RoomSummaryQueryParams(
|
||||||
var roomTagQueryFilter: RoomTagQueryFilter? = null
|
var roomTagQueryFilter: RoomTagQueryFilter? = null
|
||||||
var excludeType: List<String?>? = listOf(RoomType.SPACE)
|
var excludeType: List<String?>? = listOf(RoomType.SPACE)
|
||||||
var includeType: List<String?>? = null
|
var includeType: List<String?>? = null
|
||||||
var activeSpaceFilter: ActiveSpaceFilter? = null
|
var spaceFilter: SpaceFilter? = null
|
||||||
var activeGroupId: String? = null
|
var activeGroupId: String? = null
|
||||||
|
|
||||||
fun build() = RoomSummaryQueryParams(
|
fun build() = RoomSummaryQueryParams(
|
||||||
|
@ -112,7 +112,7 @@ data class RoomSummaryQueryParams(
|
||||||
roomTagQueryFilter = roomTagQueryFilter,
|
roomTagQueryFilter = roomTagQueryFilter,
|
||||||
excludeType = excludeType,
|
excludeType = excludeType,
|
||||||
includeType = includeType,
|
includeType = includeType,
|
||||||
activeSpaceFilter = activeSpaceFilter,
|
spaceFilter = spaceFilter,
|
||||||
activeGroupId = activeGroupId
|
activeGroupId = activeGroupId
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,9 +26,9 @@ import com.zhuinden.monarchy.Monarchy
|
||||||
import io.realm.Realm
|
import io.realm.Realm
|
||||||
import io.realm.RealmQuery
|
import io.realm.RealmQuery
|
||||||
import io.realm.kotlin.where
|
import io.realm.kotlin.where
|
||||||
import org.matrix.android.sdk.api.query.ActiveSpaceFilter
|
|
||||||
import org.matrix.android.sdk.api.query.QueryStringValue
|
import org.matrix.android.sdk.api.query.QueryStringValue
|
||||||
import org.matrix.android.sdk.api.query.RoomCategoryFilter
|
import org.matrix.android.sdk.api.query.RoomCategoryFilter
|
||||||
|
import org.matrix.android.sdk.api.query.SpaceFilter
|
||||||
import org.matrix.android.sdk.api.query.isNormalized
|
import org.matrix.android.sdk.api.query.isNormalized
|
||||||
import org.matrix.android.sdk.api.session.room.ResultBoundaries
|
import org.matrix.android.sdk.api.session.room.ResultBoundaries
|
||||||
import org.matrix.android.sdk.api.session.room.RoomSortOrder
|
import org.matrix.android.sdk.api.session.room.RoomSortOrder
|
||||||
|
@ -300,21 +300,21 @@ internal class RoomSummaryDataSource @Inject constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Timber.w("VAL: activeSpaceId : ${queryParams.activeSpaceId}")
|
// Timber.w("VAL: activeSpaceId : ${queryParams.activeSpaceId}")
|
||||||
when (queryParams.activeSpaceFilter) {
|
when (queryParams.spaceFilter) {
|
||||||
is ActiveSpaceFilter.ActiveSpace -> {
|
is SpaceFilter.ActiveSpace -> {
|
||||||
// It's annoying but for now realm java does not support querying in primitive list :/
|
// It's annoying but for now realm java does not support querying in primitive list :/
|
||||||
// https://github.com/realm/realm-java/issues/5361
|
// https://github.com/realm/realm-java/issues/5361
|
||||||
if (queryParams.activeSpaceFilter.currentSpaceId == null) {
|
if (queryParams.spaceFilter.currentSpaceId == null) {
|
||||||
// orphan rooms
|
// orphan rooms
|
||||||
query.isNull(RoomSummaryEntityFields.FLATTEN_PARENT_IDS)
|
query.isNull(RoomSummaryEntityFields.FLATTEN_PARENT_IDS)
|
||||||
} else {
|
} else {
|
||||||
query.contains(RoomSummaryEntityFields.FLATTEN_PARENT_IDS, queryParams.activeSpaceFilter.currentSpaceId)
|
query.contains(RoomSummaryEntityFields.FLATTEN_PARENT_IDS, queryParams.spaceFilter.currentSpaceId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
is ActiveSpaceFilter.ExcludeSpace -> {
|
is SpaceFilter.ExcludeSpace -> {
|
||||||
query.not().contains(RoomSummaryEntityFields.FLATTEN_PARENT_IDS, queryParams.activeSpaceFilter.spaceId)
|
query.not().contains(RoomSummaryEntityFields.FLATTEN_PARENT_IDS, queryParams.spaceFilter.spaceId)
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
// nop
|
// nop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,8 +45,8 @@ import kotlinx.coroutines.flow.flatMapLatest
|
||||||
import kotlinx.coroutines.flow.launchIn
|
import kotlinx.coroutines.flow.launchIn
|
||||||
import kotlinx.coroutines.flow.onEach
|
import kotlinx.coroutines.flow.onEach
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import org.matrix.android.sdk.api.query.ActiveSpaceFilter
|
|
||||||
import org.matrix.android.sdk.api.query.RoomCategoryFilter
|
import org.matrix.android.sdk.api.query.RoomCategoryFilter
|
||||||
|
import org.matrix.android.sdk.api.query.SpaceFilter
|
||||||
import org.matrix.android.sdk.api.session.Session
|
import org.matrix.android.sdk.api.session.Session
|
||||||
import org.matrix.android.sdk.api.session.crypto.NewSessionListener
|
import org.matrix.android.sdk.api.session.crypto.NewSessionListener
|
||||||
import org.matrix.android.sdk.api.session.initsync.SyncStatusService
|
import org.matrix.android.sdk.api.session.initsync.SyncStatusService
|
||||||
|
@ -241,7 +241,7 @@ class HomeDetailViewModel @AssistedInject constructor(
|
||||||
roomSummaryQueryParams {
|
roomSummaryQueryParams {
|
||||||
memberships = listOf(Membership.INVITE)
|
memberships = listOf(Membership.INVITE)
|
||||||
roomCategoryFilter = RoomCategoryFilter.ONLY_DM
|
roomCategoryFilter = RoomCategoryFilter.ONLY_DM
|
||||||
activeSpaceFilter = activeSpaceRoomId?.let { ActiveSpaceFilter.ActiveSpace(it) }
|
spaceFilter = activeSpaceRoomId?.let { SpaceFilter.ActiveSpace(it) }
|
||||||
}
|
}
|
||||||
).size
|
).size
|
||||||
|
|
||||||
|
@ -249,7 +249,7 @@ class HomeDetailViewModel @AssistedInject constructor(
|
||||||
roomSummaryQueryParams {
|
roomSummaryQueryParams {
|
||||||
memberships = listOf(Membership.INVITE)
|
memberships = listOf(Membership.INVITE)
|
||||||
roomCategoryFilter = RoomCategoryFilter.ONLY_ROOMS
|
roomCategoryFilter = RoomCategoryFilter.ONLY_ROOMS
|
||||||
activeSpaceFilter = ActiveSpaceFilter.ActiveSpace(groupingMethod.spaceSummary?.roomId)
|
spaceFilter = SpaceFilter.ActiveSpace(groupingMethod.spaceSummary?.roomId)
|
||||||
}
|
}
|
||||||
).size
|
).size
|
||||||
}
|
}
|
||||||
|
@ -258,7 +258,7 @@ class HomeDetailViewModel @AssistedInject constructor(
|
||||||
roomSummaryQueryParams {
|
roomSummaryQueryParams {
|
||||||
memberships = listOf(Membership.JOIN)
|
memberships = listOf(Membership.JOIN)
|
||||||
roomCategoryFilter = RoomCategoryFilter.ONLY_DM
|
roomCategoryFilter = RoomCategoryFilter.ONLY_DM
|
||||||
activeSpaceFilter = activeSpaceRoomId?.let { ActiveSpaceFilter.ActiveSpace(it) }
|
spaceFilter = activeSpaceRoomId?.let { SpaceFilter.ActiveSpace(it) }
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -266,7 +266,7 @@ class HomeDetailViewModel @AssistedInject constructor(
|
||||||
roomSummaryQueryParams {
|
roomSummaryQueryParams {
|
||||||
memberships = listOf(Membership.JOIN)
|
memberships = listOf(Membership.JOIN)
|
||||||
roomCategoryFilter = RoomCategoryFilter.ONLY_ROOMS
|
roomCategoryFilter = RoomCategoryFilter.ONLY_ROOMS
|
||||||
activeSpaceFilter = ActiveSpaceFilter.ActiveSpace(groupingMethod.spaceSummary?.roomId)
|
spaceFilter = SpaceFilter.ActiveSpace(groupingMethod.spaceSummary?.roomId)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ import kotlinx.coroutines.flow.combine
|
||||||
import kotlinx.coroutines.flow.distinctUntilChanged
|
import kotlinx.coroutines.flow.distinctUntilChanged
|
||||||
import kotlinx.coroutines.flow.flatMapLatest
|
import kotlinx.coroutines.flow.flatMapLatest
|
||||||
import kotlinx.coroutines.flow.flowOn
|
import kotlinx.coroutines.flow.flowOn
|
||||||
import org.matrix.android.sdk.api.query.ActiveSpaceFilter
|
import org.matrix.android.sdk.api.query.SpaceFilter
|
||||||
import org.matrix.android.sdk.api.session.Session
|
import org.matrix.android.sdk.api.session.Session
|
||||||
import org.matrix.android.sdk.api.session.room.RoomSortOrder
|
import org.matrix.android.sdk.api.session.room.RoomSortOrder
|
||||||
import org.matrix.android.sdk.api.session.room.model.Membership
|
import org.matrix.android.sdk.api.session.room.model.Membership
|
||||||
|
@ -78,7 +78,7 @@ class UnreadMessagesSharedViewModel @AssistedInject constructor(@Assisted initia
|
||||||
roomService.getPagedRoomSummariesLive(
|
roomService.getPagedRoomSummariesLive(
|
||||||
roomSummaryQueryParams {
|
roomSummaryQueryParams {
|
||||||
this.memberships = listOf(Membership.JOIN)
|
this.memberships = listOf(Membership.JOIN)
|
||||||
this.activeSpaceFilter = ActiveSpaceFilter.ActiveSpace(null)
|
this.spaceFilter = SpaceFilter.ActiveSpace(null)
|
||||||
}, sortOrder = RoomSortOrder.NONE
|
}, sortOrder = RoomSortOrder.NONE
|
||||||
).asFlow()
|
).asFlow()
|
||||||
.throttleFirst(300)
|
.throttleFirst(300)
|
||||||
|
@ -86,7 +86,7 @@ class UnreadMessagesSharedViewModel @AssistedInject constructor(@Assisted initia
|
||||||
val counts = roomService.getNotificationCountForRooms(
|
val counts = roomService.getNotificationCountForRooms(
|
||||||
roomSummaryQueryParams {
|
roomSummaryQueryParams {
|
||||||
this.memberships = listOf(Membership.JOIN)
|
this.memberships = listOf(Membership.JOIN)
|
||||||
this.activeSpaceFilter = ActiveSpaceFilter.ActiveSpace(null)
|
this.spaceFilter = SpaceFilter.ActiveSpace(null)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
val invites = if (autoAcceptInvites.hideInvites) {
|
val invites = if (autoAcceptInvites.hideInvites) {
|
||||||
|
@ -95,7 +95,7 @@ class UnreadMessagesSharedViewModel @AssistedInject constructor(@Assisted initia
|
||||||
roomService.getRoomSummaries(
|
roomService.getRoomSummaries(
|
||||||
roomSummaryQueryParams {
|
roomSummaryQueryParams {
|
||||||
this.memberships = listOf(Membership.INVITE)
|
this.memberships = listOf(Membership.INVITE)
|
||||||
this.activeSpaceFilter = ActiveSpaceFilter.ActiveSpace(null)
|
this.spaceFilter = SpaceFilter.ActiveSpace(null)
|
||||||
}
|
}
|
||||||
).size
|
).size
|
||||||
}
|
}
|
||||||
|
@ -151,7 +151,7 @@ class UnreadMessagesSharedViewModel @AssistedInject constructor(@Assisted initia
|
||||||
val totalCount = roomService.getNotificationCountForRooms(
|
val totalCount = roomService.getNotificationCountForRooms(
|
||||||
roomSummaryQueryParams {
|
roomSummaryQueryParams {
|
||||||
this.memberships = listOf(Membership.JOIN)
|
this.memberships = listOf(Membership.JOIN)
|
||||||
this.activeSpaceFilter = ActiveSpaceFilter.ActiveSpace(null).takeIf {
|
this.spaceFilter = SpaceFilter.ActiveSpace(null).takeIf {
|
||||||
!vectorPreferences.prefSpacesShowAllRoomInHome()
|
!vectorPreferences.prefSpacesShowAllRoomInHome()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,9 +43,9 @@ import kotlinx.coroutines.flow.map
|
||||||
import kotlinx.coroutines.flow.onEach
|
import kotlinx.coroutines.flow.onEach
|
||||||
import kotlinx.coroutines.flow.update
|
import kotlinx.coroutines.flow.update
|
||||||
import org.matrix.android.sdk.api.extensions.tryOrNull
|
import org.matrix.android.sdk.api.extensions.tryOrNull
|
||||||
import org.matrix.android.sdk.api.query.ActiveSpaceFilter
|
|
||||||
import org.matrix.android.sdk.api.query.RoomCategoryFilter
|
import org.matrix.android.sdk.api.query.RoomCategoryFilter
|
||||||
import org.matrix.android.sdk.api.query.RoomTagQueryFilter
|
import org.matrix.android.sdk.api.query.RoomTagQueryFilter
|
||||||
|
import org.matrix.android.sdk.api.query.SpaceFilter
|
||||||
import org.matrix.android.sdk.api.session.Session
|
import org.matrix.android.sdk.api.session.Session
|
||||||
import org.matrix.android.sdk.api.session.getRoomSummary
|
import org.matrix.android.sdk.api.session.getRoomSummary
|
||||||
import org.matrix.android.sdk.api.session.room.RoomSummaryQueryParams
|
import org.matrix.android.sdk.api.session.room.RoomSummaryQueryParams
|
||||||
|
@ -370,7 +370,7 @@ class RoomListSectionBuilderSpace(
|
||||||
activeSpaceUpdaters.add(object : RoomListViewModel.ActiveSpaceQueryUpdater {
|
activeSpaceUpdaters.add(object : RoomListViewModel.ActiveSpaceQueryUpdater {
|
||||||
override fun updateForSpaceId(roomId: String?) {
|
override fun updateForSpaceId(roomId: String?) {
|
||||||
filteredPagedRoomSummariesLive.queryParams = roomQueryParams.copy(
|
filteredPagedRoomSummariesLive.queryParams = roomQueryParams.copy(
|
||||||
activeSpaceFilter = ActiveSpaceFilter.ActiveSpace(roomId)
|
spaceFilter = SpaceFilter.ActiveSpace(roomId)
|
||||||
)
|
)
|
||||||
liveQueryParams.update { filteredPagedRoomSummariesLive.queryParams }
|
liveQueryParams.update { filteredPagedRoomSummariesLive.queryParams }
|
||||||
}
|
}
|
||||||
|
@ -381,11 +381,11 @@ class RoomListSectionBuilderSpace(
|
||||||
override fun updateForSpaceId(roomId: String?) {
|
override fun updateForSpaceId(roomId: String?) {
|
||||||
if (roomId != null) {
|
if (roomId != null) {
|
||||||
filteredPagedRoomSummariesLive.queryParams = roomQueryParams.copy(
|
filteredPagedRoomSummariesLive.queryParams = roomQueryParams.copy(
|
||||||
activeSpaceFilter = ActiveSpaceFilter.ActiveSpace(roomId)
|
spaceFilter = SpaceFilter.ActiveSpace(roomId)
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
filteredPagedRoomSummariesLive.queryParams = roomQueryParams.copy(
|
filteredPagedRoomSummariesLive.queryParams = roomQueryParams.copy(
|
||||||
activeSpaceFilter = null
|
spaceFilter = null
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
liveQueryParams.update { filteredPagedRoomSummariesLive.queryParams }
|
liveQueryParams.update { filteredPagedRoomSummariesLive.queryParams }
|
||||||
|
@ -436,17 +436,17 @@ class RoomListSectionBuilderSpace(
|
||||||
return when (spaceFilter) {
|
return when (spaceFilter) {
|
||||||
RoomListViewModel.SpaceFilterStrategy.ORPHANS_IF_SPACE_NULL -> {
|
RoomListViewModel.SpaceFilterStrategy.ORPHANS_IF_SPACE_NULL -> {
|
||||||
copy(
|
copy(
|
||||||
activeSpaceFilter = ActiveSpaceFilter.ActiveSpace(currentSpace)
|
spaceFilter = SpaceFilter.ActiveSpace(currentSpace)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
RoomListViewModel.SpaceFilterStrategy.ALL_IF_SPACE_NULL -> {
|
RoomListViewModel.SpaceFilterStrategy.ALL_IF_SPACE_NULL -> {
|
||||||
if (currentSpace == null) {
|
if (currentSpace == null) {
|
||||||
copy(
|
copy(
|
||||||
activeSpaceFilter = null
|
spaceFilter = null
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
copy(
|
copy(
|
||||||
activeSpaceFilter = ActiveSpaceFilter.ActiveSpace(currentSpace)
|
spaceFilter = SpaceFilter.ActiveSpace(currentSpace)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,8 +44,8 @@ import kotlinx.coroutines.flow.onEach
|
||||||
import kotlinx.coroutines.flow.sample
|
import kotlinx.coroutines.flow.sample
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import org.matrix.android.sdk.api.extensions.tryOrNull
|
import org.matrix.android.sdk.api.extensions.tryOrNull
|
||||||
import org.matrix.android.sdk.api.query.ActiveSpaceFilter
|
|
||||||
import org.matrix.android.sdk.api.query.QueryStringValue
|
import org.matrix.android.sdk.api.query.QueryStringValue
|
||||||
|
import org.matrix.android.sdk.api.query.SpaceFilter
|
||||||
import org.matrix.android.sdk.api.session.Session
|
import org.matrix.android.sdk.api.session.Session
|
||||||
import org.matrix.android.sdk.api.session.events.model.toContent
|
import org.matrix.android.sdk.api.session.events.model.toContent
|
||||||
import org.matrix.android.sdk.api.session.events.model.toModel
|
import org.matrix.android.sdk.api.session.events.model.toModel
|
||||||
|
@ -110,7 +110,7 @@ class SpaceListViewModel @AssistedInject constructor(@Assisted initialState: Spa
|
||||||
session.roomService().getPagedRoomSummariesLive(
|
session.roomService().getPagedRoomSummariesLive(
|
||||||
roomSummaryQueryParams {
|
roomSummaryQueryParams {
|
||||||
this.memberships = listOf(Membership.JOIN)
|
this.memberships = listOf(Membership.JOIN)
|
||||||
this.activeSpaceFilter = ActiveSpaceFilter.ActiveSpace(null).takeIf {
|
this.spaceFilter = SpaceFilter.ActiveSpace(null).takeIf {
|
||||||
!vectorPreferences.prefSpacesShowAllRoomInHome()
|
!vectorPreferences.prefSpacesShowAllRoomInHome()
|
||||||
}
|
}
|
||||||
}, sortOrder = RoomSortOrder.NONE
|
}, sortOrder = RoomSortOrder.NONE
|
||||||
|
@ -127,7 +127,7 @@ class SpaceListViewModel @AssistedInject constructor(@Assisted initialState: Spa
|
||||||
val totalCount = session.roomService().getNotificationCountForRooms(
|
val totalCount = session.roomService().getNotificationCountForRooms(
|
||||||
roomSummaryQueryParams {
|
roomSummaryQueryParams {
|
||||||
this.memberships = listOf(Membership.JOIN)
|
this.memberships = listOf(Membership.JOIN)
|
||||||
this.activeSpaceFilter = ActiveSpaceFilter.ActiveSpace(null).takeIf {
|
this.spaceFilter = SpaceFilter.ActiveSpace(null).takeIf {
|
||||||
!vectorPreferences.prefSpacesShowAllRoomInHome()
|
!vectorPreferences.prefSpacesShowAllRoomInHome()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,8 @@ import im.vector.app.features.session.coroutineScope
|
||||||
import kotlinx.coroutines.flow.launchIn
|
import kotlinx.coroutines.flow.launchIn
|
||||||
import kotlinx.coroutines.flow.onEach
|
import kotlinx.coroutines.flow.onEach
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import org.matrix.android.sdk.api.query.ActiveSpaceFilter
|
|
||||||
import org.matrix.android.sdk.api.query.RoomCategoryFilter
|
import org.matrix.android.sdk.api.query.RoomCategoryFilter
|
||||||
|
import org.matrix.android.sdk.api.query.SpaceFilter
|
||||||
import org.matrix.android.sdk.api.session.Session
|
import org.matrix.android.sdk.api.session.Session
|
||||||
import org.matrix.android.sdk.api.session.events.model.EventType
|
import org.matrix.android.sdk.api.session.events.model.EventType
|
||||||
import org.matrix.android.sdk.api.session.getRoom
|
import org.matrix.android.sdk.api.session.getRoom
|
||||||
|
@ -141,7 +141,7 @@ class SpaceMenuViewModel @AssistedInject constructor(
|
||||||
session.roomService().getRoomSummaries(
|
session.roomService().getRoomSummaries(
|
||||||
roomSummaryQueryParams {
|
roomSummaryQueryParams {
|
||||||
excludeType = null
|
excludeType = null
|
||||||
activeSpaceFilter = ActiveSpaceFilter.ActiveSpace(initialState.spaceId)
|
spaceFilter = SpaceFilter.ActiveSpace(initialState.spaceId)
|
||||||
memberships = listOf(Membership.JOIN)
|
memberships = listOf(Membership.JOIN)
|
||||||
roomCategoryFilter = RoomCategoryFilter.ONLY_ROOMS
|
roomCategoryFilter = RoomCategoryFilter.ONLY_ROOMS
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,8 +33,8 @@ import kotlinx.coroutines.flow.launchIn
|
||||||
import kotlinx.coroutines.flow.onEach
|
import kotlinx.coroutines.flow.onEach
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import okhttp3.internal.toImmutableList
|
import okhttp3.internal.toImmutableList
|
||||||
import org.matrix.android.sdk.api.query.ActiveSpaceFilter
|
|
||||||
import org.matrix.android.sdk.api.query.RoomCategoryFilter
|
import org.matrix.android.sdk.api.query.RoomCategoryFilter
|
||||||
|
import org.matrix.android.sdk.api.query.SpaceFilter
|
||||||
import org.matrix.android.sdk.api.session.Session
|
import org.matrix.android.sdk.api.session.Session
|
||||||
import org.matrix.android.sdk.api.session.events.model.EventType
|
import org.matrix.android.sdk.api.session.events.model.EventType
|
||||||
import org.matrix.android.sdk.api.session.events.model.toModel
|
import org.matrix.android.sdk.api.session.events.model.toModel
|
||||||
|
@ -93,7 +93,7 @@ class SpaceLeaveAdvancedViewModel @AssistedInject constructor(
|
||||||
roomSummaryQueryParams {
|
roomSummaryQueryParams {
|
||||||
includeType = null
|
includeType = null
|
||||||
memberships = listOf(Membership.JOIN)
|
memberships = listOf(Membership.JOIN)
|
||||||
activeSpaceFilter = ActiveSpaceFilter.ActiveSpace(initialState.spaceId)
|
spaceFilter = SpaceFilter.ActiveSpace(initialState.spaceId)
|
||||||
roomCategoryFilter = RoomCategoryFilter.ONLY_ROOMS
|
roomCategoryFilter = RoomCategoryFilter.ONLY_ROOMS
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
@ -35,9 +35,9 @@ import kotlinx.coroutines.flow.distinctUntilChanged
|
||||||
import kotlinx.coroutines.flow.flatMapLatest
|
import kotlinx.coroutines.flow.flatMapLatest
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import org.matrix.android.sdk.api.query.ActiveSpaceFilter
|
|
||||||
import org.matrix.android.sdk.api.query.QueryStringValue
|
import org.matrix.android.sdk.api.query.QueryStringValue
|
||||||
import org.matrix.android.sdk.api.query.RoomCategoryFilter
|
import org.matrix.android.sdk.api.query.RoomCategoryFilter
|
||||||
|
import org.matrix.android.sdk.api.query.SpaceFilter
|
||||||
import org.matrix.android.sdk.api.session.Session
|
import org.matrix.android.sdk.api.session.Session
|
||||||
import org.matrix.android.sdk.api.session.getRoomSummary
|
import org.matrix.android.sdk.api.session.getRoomSummary
|
||||||
import org.matrix.android.sdk.api.session.room.RoomSortOrder
|
import org.matrix.android.sdk.api.session.room.RoomSortOrder
|
||||||
|
@ -72,7 +72,7 @@ class SpaceAddRoomsViewModel @AssistedInject constructor(
|
||||||
this.memberships = listOf(Membership.JOIN)
|
this.memberships = listOf(Membership.JOIN)
|
||||||
this.excludeType = null
|
this.excludeType = null
|
||||||
this.includeType = listOf(RoomType.SPACE)
|
this.includeType = listOf(RoomType.SPACE)
|
||||||
this.activeSpaceFilter = ActiveSpaceFilter.ExcludeSpace(initialState.spaceId)
|
this.spaceFilter = SpaceFilter.ExcludeSpace(initialState.spaceId)
|
||||||
this.displayName = QueryStringValue.Contains(initialState.currentFilter, QueryStringValue.Case.INSENSITIVE)
|
this.displayName = QueryStringValue.Contains(initialState.currentFilter, QueryStringValue.Case.INSENSITIVE)
|
||||||
},
|
},
|
||||||
pagedListConfig = PagedList.Config.Builder()
|
pagedListConfig = PagedList.Config.Builder()
|
||||||
|
@ -98,7 +98,7 @@ class SpaceAddRoomsViewModel @AssistedInject constructor(
|
||||||
this.excludeType = listOf(RoomType.SPACE)
|
this.excludeType = listOf(RoomType.SPACE)
|
||||||
this.includeType = null
|
this.includeType = null
|
||||||
this.roomCategoryFilter = RoomCategoryFilter.ONLY_ROOMS
|
this.roomCategoryFilter = RoomCategoryFilter.ONLY_ROOMS
|
||||||
this.activeSpaceFilter = ActiveSpaceFilter.ExcludeSpace(initialState.spaceId)
|
this.spaceFilter = SpaceFilter.ExcludeSpace(initialState.spaceId)
|
||||||
this.displayName = QueryStringValue.Contains(initialState.currentFilter, QueryStringValue.Case.INSENSITIVE)
|
this.displayName = QueryStringValue.Contains(initialState.currentFilter, QueryStringValue.Case.INSENSITIVE)
|
||||||
},
|
},
|
||||||
pagedListConfig = PagedList.Config.Builder()
|
pagedListConfig = PagedList.Config.Builder()
|
||||||
|
@ -124,7 +124,7 @@ class SpaceAddRoomsViewModel @AssistedInject constructor(
|
||||||
this.excludeType = listOf(RoomType.SPACE)
|
this.excludeType = listOf(RoomType.SPACE)
|
||||||
this.includeType = null
|
this.includeType = null
|
||||||
this.roomCategoryFilter = RoomCategoryFilter.ONLY_DM
|
this.roomCategoryFilter = RoomCategoryFilter.ONLY_DM
|
||||||
this.activeSpaceFilter = ActiveSpaceFilter.ExcludeSpace(initialState.spaceId)
|
this.spaceFilter = SpaceFilter.ExcludeSpace(initialState.spaceId)
|
||||||
this.displayName = QueryStringValue.Contains(initialState.currentFilter, QueryStringValue.Case.INSENSITIVE)
|
this.displayName = QueryStringValue.Contains(initialState.currentFilter, QueryStringValue.Case.INSENSITIVE)
|
||||||
},
|
},
|
||||||
pagedListConfig = PagedList.Config.Builder()
|
pagedListConfig = PagedList.Config.Builder()
|
||||||
|
|
Loading…
Reference in a new issue