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?) {
|
private suspend fun pauseVoiceBroadcast(room: Room, reference: RelationDefaultContent?) {
|
||||||
Timber.d("## PauseVoiceBroadcastUseCase: Send new voice broadcast info state event")
|
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()
|
pauseRecording()
|
||||||
|
|
||||||
room.stateService().sendStateEvent(
|
room.stateService().sendStateEvent(
|
||||||
|
@ -63,7 +64,7 @@ class PauseVoiceBroadcastUseCase @Inject constructor(
|
||||||
body = MessageVoiceBroadcastInfoContent(
|
body = MessageVoiceBroadcastInfoContent(
|
||||||
relatesTo = reference,
|
relatesTo = reference,
|
||||||
voiceBroadcastStateStr = VoiceBroadcastState.PAUSED.value,
|
voiceBroadcastStateStr = VoiceBroadcastState.PAUSED.value,
|
||||||
lastChunkSequence = voiceBroadcastRecorder?.currentSequence,
|
lastChunkSequence = lastSequence,
|
||||||
).toContent(),
|
).toContent(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,8 @@ class StopVoiceBroadcastUseCase @Inject constructor(
|
||||||
private suspend fun stopVoiceBroadcast(room: Room, reference: RelationDefaultContent?) {
|
private suspend fun stopVoiceBroadcast(room: Room, reference: RelationDefaultContent?) {
|
||||||
Timber.d("## StopVoiceBroadcastUseCase: Send new voice broadcast info state event")
|
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()
|
stopRecording()
|
||||||
|
|
||||||
room.stateService().sendStateEvent(
|
room.stateService().sendStateEvent(
|
||||||
|
@ -64,7 +65,7 @@ class StopVoiceBroadcastUseCase @Inject constructor(
|
||||||
body = MessageVoiceBroadcastInfoContent(
|
body = MessageVoiceBroadcastInfoContent(
|
||||||
relatesTo = reference,
|
relatesTo = reference,
|
||||||
voiceBroadcastStateStr = VoiceBroadcastState.STOPPED.value,
|
voiceBroadcastStateStr = VoiceBroadcastState.STOPPED.value,
|
||||||
lastChunkSequence = voiceBroadcastRecorder?.currentSequence,
|
lastChunkSequence = lastSequence,
|
||||||
).toContent(),
|
).toContent(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue