mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 17:35:54 +03:00
Remove ActiveSpaceFilter.None
Prefer nullability for API coherency of `RoomSummaryQueryParams`
This commit is contained in:
parent
289f27b738
commit
00809027c1
6 changed files with 8 additions and 9 deletions
|
@ -21,7 +21,6 @@ package org.matrix.android.sdk.api.query
|
|||
* @see [org.matrix.android.sdk.api.session.room.RoomSummaryQueryParams]
|
||||
*/
|
||||
sealed class ActiveSpaceFilter {
|
||||
object None : ActiveSpaceFilter()
|
||||
data class ActiveSpace(val currentSpaceId: String?) : ActiveSpaceFilter()
|
||||
data class ExcludeSpace(val spaceId: String) : ActiveSpaceFilter()
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ data class RoomSummaryQueryParams(
|
|||
var roomTagQueryFilter: RoomTagQueryFilter? = null
|
||||
var excludeType: List<String?>? = listOf(RoomType.SPACE)
|
||||
var includeType: List<String?>? = null
|
||||
var activeSpaceFilter: ActiveSpaceFilter = ActiveSpaceFilter.None
|
||||
var activeSpaceFilter: ActiveSpaceFilter? = null
|
||||
var activeGroupId: String? = null
|
||||
|
||||
fun build() = RoomSummaryQueryParams(
|
||||
|
|
|
@ -241,7 +241,7 @@ class HomeDetailViewModel @AssistedInject constructor(
|
|||
roomSummaryQueryParams {
|
||||
memberships = listOf(Membership.INVITE)
|
||||
roomCategoryFilter = RoomCategoryFilter.ONLY_DM
|
||||
activeSpaceFilter = activeSpaceRoomId?.let { ActiveSpaceFilter.ActiveSpace(it) } ?: ActiveSpaceFilter.None
|
||||
activeSpaceFilter = activeSpaceRoomId?.let { ActiveSpaceFilter.ActiveSpace(it) }
|
||||
}
|
||||
).size
|
||||
|
||||
|
@ -258,7 +258,7 @@ class HomeDetailViewModel @AssistedInject constructor(
|
|||
roomSummaryQueryParams {
|
||||
memberships = listOf(Membership.JOIN)
|
||||
roomCategoryFilter = RoomCategoryFilter.ONLY_DM
|
||||
activeSpaceFilter = activeSpaceRoomId?.let { ActiveSpaceFilter.ActiveSpace(it) } ?: ActiveSpaceFilter.None
|
||||
activeSpaceFilter = activeSpaceRoomId?.let { ActiveSpaceFilter.ActiveSpace(it) }
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ class UnreadMessagesSharedViewModel @AssistedInject constructor(@Assisted initia
|
|||
this.memberships = listOf(Membership.JOIN)
|
||||
this.activeSpaceFilter = ActiveSpaceFilter.ActiveSpace(null).takeIf {
|
||||
!vectorPreferences.prefSpacesShowAllRoomInHome()
|
||||
} ?: ActiveSpaceFilter.None
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
@ -385,7 +385,7 @@ class RoomListSectionBuilderSpace(
|
|||
)
|
||||
} else {
|
||||
filteredPagedRoomSummariesLive.queryParams = roomQueryParams.copy(
|
||||
activeSpaceFilter = ActiveSpaceFilter.None
|
||||
activeSpaceFilter = null
|
||||
)
|
||||
}
|
||||
liveQueryParams.update { filteredPagedRoomSummariesLive.queryParams }
|
||||
|
@ -442,7 +442,7 @@ class RoomListSectionBuilderSpace(
|
|||
RoomListViewModel.SpaceFilterStrategy.ALL_IF_SPACE_NULL -> {
|
||||
if (currentSpace == null) {
|
||||
copy(
|
||||
activeSpaceFilter = ActiveSpaceFilter.None
|
||||
activeSpaceFilter = null
|
||||
)
|
||||
} else {
|
||||
copy(
|
||||
|
|
|
@ -112,7 +112,7 @@ class SpaceListViewModel @AssistedInject constructor(@Assisted initialState: Spa
|
|||
this.memberships = listOf(Membership.JOIN)
|
||||
this.activeSpaceFilter = ActiveSpaceFilter.ActiveSpace(null).takeIf {
|
||||
!vectorPreferences.prefSpacesShowAllRoomInHome()
|
||||
} ?: ActiveSpaceFilter.None
|
||||
}
|
||||
}, sortOrder = RoomSortOrder.NONE
|
||||
).asFlow()
|
||||
.sample(300)
|
||||
|
@ -129,7 +129,7 @@ class SpaceListViewModel @AssistedInject constructor(@Assisted initialState: Spa
|
|||
this.memberships = listOf(Membership.JOIN)
|
||||
this.activeSpaceFilter = ActiveSpaceFilter.ActiveSpace(null).takeIf {
|
||||
!vectorPreferences.prefSpacesShowAllRoomInHome()
|
||||
} ?: ActiveSpaceFilter.None
|
||||
}
|
||||
}
|
||||
)
|
||||
val counts = RoomAggregateNotificationCount(
|
||||
|
|
Loading…
Reference in a new issue