Merge pull request #7502 from vector-im/bugfix/fre/voice_broadcast_duplicated_chunks
Voice Broadcast - Fix duplicated chunks in the internal playlist during live broadcasts
This commit is contained in:
commit
dac89add67
|
@ -0,0 +1 @@
|
|||
Voice Broadcast - Fix duplicated voice messages in the internal playlist
|
|
@ -29,6 +29,7 @@ import kotlinx.coroutines.flow.Flow
|
|||
import kotlinx.coroutines.flow.callbackFlow
|
||||
import kotlinx.coroutines.flow.emptyFlow
|
||||
import kotlinx.coroutines.flow.flowOf
|
||||
import kotlinx.coroutines.flow.map
|
||||
import kotlinx.coroutines.flow.runningReduce
|
||||
import org.matrix.android.sdk.api.session.events.model.RelationType
|
||||
import org.matrix.android.sdk.api.session.room.model.message.MessageAudioEvent
|
||||
|
@ -106,6 +107,7 @@ class GetLiveVoiceBroadcastChunksUseCase @Inject constructor(
|
|||
}
|
||||
}
|
||||
.runningReduce { accumulator: List<MessageAudioEvent>, value: List<MessageAudioEvent> -> accumulator.plus(value) }
|
||||
.map { events -> events.distinctBy { it.sequence } }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue