mirror of
https://github.com/vector-im/riotX-android
synced 2025-10-06 00:02:48 +02:00
Add function to provide a Flow of a single UserAccountDataEvent
This commit is contained in:
@@ -152,6 +152,13 @@ class FlowSession(private val session: Session) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun liveUserAccountData(type: String): Flow<Optional<UserAccountDataEvent>> {
|
||||||
|
return session.accountDataService().getLiveUserAccountDataEvent(type).asFlow()
|
||||||
|
.startWith(session.coroutineDispatchers.io) {
|
||||||
|
session.accountDataService().getUserAccountDataEvent(type).toOptional()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun liveRoomAccountData(types: Set<String>): Flow<List<RoomAccountDataEvent>> {
|
fun liveRoomAccountData(types: Set<String>): Flow<List<RoomAccountDataEvent>> {
|
||||||
return session.accountDataService().getLiveRoomAccountDataEvents(types).asFlow()
|
return session.accountDataService().getLiveRoomAccountDataEvents(types).asFlow()
|
||||||
.startWith(session.coroutineDispatchers.io) {
|
.startWith(session.coroutineDispatchers.io) {
|
||||||
|
Reference in New Issue
Block a user