mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-18 04:50:08 +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()
|
room.flow()
|
||||||
.liveStateEvent(VoiceBroadcastConstants.STATE_ROOM_VOICE_BROADCAST_INFO, QueryStringValue.Equals(voiceBroadcastEvent.root.stateKey!!))
|
.liveStateEvent(VoiceBroadcastConstants.STATE_ROOM_VOICE_BROADCAST_INFO, QueryStringValue.Equals(voiceBroadcastEvent.root.stateKey!!))
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.mapNotNull { it.asVoiceBroadcastEvent()?.content?.voiceBroadcastState }
|
.mapNotNull { event ->
|
||||||
|
event.asVoiceBroadcastEvent()
|
||||||
|
?.takeIf { it.reference?.eventId == eventId }
|
||||||
|
?.content?.voiceBroadcastState
|
||||||
|
}
|
||||||
.onEach { state ->
|
.onEach { state ->
|
||||||
when (state) {
|
when (state) {
|
||||||
VoiceBroadcastState.STARTED,
|
VoiceBroadcastState.STARTED,
|
||||||
|
|
Loading…
Add table
Reference in a new issue