mirror of
https://github.com/element-hq/element-android
synced 2024-11-27 11:59:12 +03:00
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
2 changed files with 3 additions and 0 deletions
1
changelog.d/7502.bugfix
Normal file
1
changelog.d/7502.bugfix
Normal file
|
@ -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 a new issue