mirror of
https://github.com/element-hq/element-android
synced 2024-11-27 11:59:12 +03:00
VoiceBroadcastPlayer - Filter live broadcast state listening on the referenced eventId
This commit is contained in:
parent
6d6b4e5208
commit
94390697ae
1 changed files with 5 additions and 1 deletions
|
@ -179,7 +179,11 @@ class VoiceBroadcastPlayer @Inject constructor(
|
|||
room.flow()
|
||||
.liveStateEvent(VoiceBroadcastConstants.STATE_ROOM_VOICE_BROADCAST_INFO, QueryStringValue.Equals(voiceBroadcastEvent.root.stateKey!!))
|
||||
.unwrap()
|
||||
.mapNotNull { it.asVoiceBroadcastEvent()?.content?.voiceBroadcastState }
|
||||
.mapNotNull { event ->
|
||||
event.asVoiceBroadcastEvent()
|
||||
?.takeIf { it.reference?.eventId == eventId }
|
||||
?.content?.voiceBroadcastState
|
||||
}
|
||||
.onEach { state ->
|
||||
when (state) {
|
||||
VoiceBroadcastState.STARTED,
|
||||
|
|
Loading…
Reference in a new issue