You've already forked element-android
mirror of
https://github.com/vector-im/element-android.git
synced 2025-07-12 06:01:41 +03:00
Ensure we do not use QueryStringValue.NoCondition
or QueryStringValue.IsNull
to query for State Event.
Also remove default value for those parameters.
This commit is contained in:
@ -18,7 +18,7 @@ package org.matrix.android.sdk.flow
|
||||
|
||||
import androidx.lifecycle.asFlow
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import org.matrix.android.sdk.api.query.QueryStringValue
|
||||
import org.matrix.android.sdk.api.query.QueryStateEventValue
|
||||
import org.matrix.android.sdk.api.session.events.model.Event
|
||||
import org.matrix.android.sdk.api.session.room.Room
|
||||
import org.matrix.android.sdk.api.session.room.getStateEvent
|
||||
@ -67,17 +67,17 @@ class FlowRoom(private val room: Room) {
|
||||
}
|
||||
}
|
||||
|
||||
fun liveStateEvent(eventType: String, stateKey: QueryStringValue): Flow<Optional<Event>> {
|
||||
fun liveStateEvent(eventType: String, stateKey: QueryStateEventValue): Flow<Optional<Event>> {
|
||||
return room.stateService().getStateEventLive(eventType, stateKey).asFlow()
|
||||
.startWith(room.coroutineDispatchers.io) {
|
||||
room.getStateEvent(eventType, stateKey).toOptional()
|
||||
}
|
||||
}
|
||||
|
||||
fun liveStateEvents(eventTypes: Set<String>): Flow<List<Event>> {
|
||||
return room.stateService().getStateEventsLive(eventTypes).asFlow()
|
||||
fun liveStateEvents(eventTypes: Set<String>, stateKey: QueryStateEventValue): Flow<List<Event>> {
|
||||
return room.stateService().getStateEventsLive(eventTypes, stateKey).asFlow()
|
||||
.startWith(room.coroutineDispatchers.io) {
|
||||
room.stateService().getStateEvents(eventTypes)
|
||||
room.stateService().getStateEvents(eventTypes, stateKey)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ package org.matrix.android.sdk.flow
|
||||
import androidx.lifecycle.asFlow
|
||||
import androidx.paging.PagedList
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import org.matrix.android.sdk.api.query.QueryStringValue
|
||||
import org.matrix.android.sdk.api.query.QueryStateEventValue
|
||||
import org.matrix.android.sdk.api.session.Session
|
||||
import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent
|
||||
import org.matrix.android.sdk.api.session.crypto.crosssigning.MXCrossSigningInfo
|
||||
@ -179,7 +179,7 @@ class FlowSession(private val session: Session) {
|
||||
|
||||
fun liveRoomWidgets(
|
||||
roomId: String,
|
||||
widgetId: QueryStringValue,
|
||||
widgetId: QueryStateEventValue,
|
||||
widgetTypes: Set<String>? = null,
|
||||
excludedTypes: Set<String>? = null
|
||||
): Flow<List<Widget>> {
|
||||
|
Reference in New Issue
Block a user