Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't wrongly show non-space invites in the space panel #5731

Merged
merged 4 commits into from
Apr 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/5731.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Don't wrongly show non-space invites in the space panel.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import org.matrix.android.sdk.api.session.room.RoomSortOrder
import org.matrix.android.sdk.api.session.room.accountdata.RoomAccountDataTypes
import org.matrix.android.sdk.api.session.room.model.Membership
import org.matrix.android.sdk.api.session.room.roomSummaryQueryParams
import org.matrix.android.sdk.api.session.room.spaceSummaryQueryParams
import org.matrix.android.sdk.api.session.room.summary.RoomAggregateNotificationCount
import org.matrix.android.sdk.api.session.space.SpaceOrderUtils
import org.matrix.android.sdk.api.session.space.model.SpaceOrderContent
Expand Down Expand Up @@ -272,11 +273,9 @@ class SpaceListViewModel @AssistedInject constructor(@Assisted initialState: Spa
}

private fun observeSpaceSummaries() {
val spaceSummaryQueryParams = roomSummaryQueryParams {
val params = spaceSummaryQueryParams {
memberships = listOf(Membership.JOIN, Membership.INVITE)
displayName = QueryStringValue.IsNotEmpty
excludeType = listOf(/**RoomType.MESSAGING,$*/
null)
}

val flowSession = session.flow()
Expand All @@ -288,7 +287,7 @@ class SpaceListViewModel @AssistedInject constructor(@Assisted initialState: Spa
it.getOrNull()
},
flowSession
.liveSpaceSummaries(spaceSummaryQueryParams),
.liveSpaceSummaries(params),
session
.accountDataService()
.getLiveRoomAccountDataEvents(setOf(RoomAccountDataTypes.EVENT_TYPE_SPACE_ORDER))
Expand Down