Fix wrong sequence number in stopped state event content
This commit is contained in:
parent
a2dee2193a
commit
d092c83774
|
@ -54,7 +54,8 @@ class PauseVoiceBroadcastUseCase @Inject constructor(
|
|||
private suspend fun pauseVoiceBroadcast(room: Room, reference: RelationDefaultContent?) {
|
||||
Timber.d("## PauseVoiceBroadcastUseCase: Send new voice broadcast info state event")
|
||||
|
||||
// immediately pause the recording
|
||||
// save the last sequence number and immediately pause the recording
|
||||
val lastSequence = voiceBroadcastRecorder?.currentSequence
|
||||
pauseRecording()
|
||||
|
||||
room.stateService().sendStateEvent(
|
||||
|
@ -63,7 +64,7 @@ class PauseVoiceBroadcastUseCase @Inject constructor(
|
|||
body = MessageVoiceBroadcastInfoContent(
|
||||
relatesTo = reference,
|
||||
voiceBroadcastStateStr = VoiceBroadcastState.PAUSED.value,
|
||||
lastChunkSequence = voiceBroadcastRecorder?.currentSequence,
|
||||
lastChunkSequence = lastSequence,
|
||||
).toContent(),
|
||||
)
|
||||
}
|
||||
|
|
|
@ -55,7 +55,8 @@ class StopVoiceBroadcastUseCase @Inject constructor(
|
|||
private suspend fun stopVoiceBroadcast(room: Room, reference: RelationDefaultContent?) {
|
||||
Timber.d("## StopVoiceBroadcastUseCase: Send new voice broadcast info state event")
|
||||
|
||||
// Immediately stop the recording
|
||||
// save the last sequence number and immediately stop the recording
|
||||
val lastSequence = voiceBroadcastRecorder?.currentSequence
|
||||
stopRecording()
|
||||
|
||||
room.stateService().sendStateEvent(
|
||||
|
@ -64,7 +65,7 @@ class StopVoiceBroadcastUseCase @Inject constructor(
|
|||
body = MessageVoiceBroadcastInfoContent(
|
||||
relatesTo = reference,
|
||||
voiceBroadcastStateStr = VoiceBroadcastState.STOPPED.value,
|
||||
lastChunkSequence = voiceBroadcastRecorder?.currentSequence,
|
||||
lastChunkSequence = lastSequence,
|
||||
).toContent(),
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue