Merge pull request #5731 from t3chguy/t3chguy/fix-room-type-misuse

Don't wrongly show non-space invites in the space panel
This commit is contained in:
Benoit Marty 2022-04-13 15:01:45 +02:00 committed by GitHub
commit 2761b35b6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

1
changelog.d/5731.bugfix Normal file
View File

@ -0,0 +1 @@
Don't wrongly show non-space invites in the space panel.

View File

@ -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.accountdata.RoomAccountDataTypes
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.roomSummaryQueryParams 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.room.summary.RoomAggregateNotificationCount
import org.matrix.android.sdk.api.session.space.SpaceOrderUtils import org.matrix.android.sdk.api.session.space.SpaceOrderUtils
import org.matrix.android.sdk.api.session.space.model.SpaceOrderContent import org.matrix.android.sdk.api.session.space.model.SpaceOrderContent
@ -272,11 +273,9 @@ class SpaceListViewModel @AssistedInject constructor(@Assisted initialState: Spa
} }
private fun observeSpaceSummaries() { private fun observeSpaceSummaries() {
val spaceSummaryQueryParams = roomSummaryQueryParams { val params = spaceSummaryQueryParams {
memberships = listOf(Membership.JOIN, Membership.INVITE) memberships = listOf(Membership.JOIN, Membership.INVITE)
displayName = QueryStringValue.IsNotEmpty displayName = QueryStringValue.IsNotEmpty
excludeType = listOf(/**RoomType.MESSAGING,$*/
null)
} }
val flowSession = session.flow() val flowSession = session.flow()
@ -288,7 +287,7 @@ class SpaceListViewModel @AssistedInject constructor(@Assisted initialState: Spa
it.getOrNull() it.getOrNull()
}, },
flowSession flowSession
.liveSpaceSummaries(spaceSummaryQueryParams), .liveSpaceSummaries(params),
session session
.accountDataService() .accountDataService()
.getLiveRoomAccountDataEvents(setOf(RoomAccountDataTypes.EVENT_TYPE_SPACE_ORDER)) .getLiveRoomAccountDataEvents(setOf(RoomAccountDataTypes.EVENT_TYPE_SPACE_ORDER))