mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 16:42:44 +02:00
Add voice broadcast initial state in bubble data (#6972)
- Add voice broadcast initial state in bubble data - Remove the local record after sending
This commit is contained in:
+7
-3
@@ -204,6 +204,9 @@ class VoiceBroadcastRecorderService: VoiceBroadcastRecorderServiceProtocol {
|
||||
convertAACToM4A(at: url) { [weak self] convertedUrl in
|
||||
guard let self = self else { return }
|
||||
|
||||
// Delete the source file.
|
||||
self.deleteRecording(at: url)
|
||||
|
||||
if let convertedUrl = convertedUrl {
|
||||
dispatchGroup.notify(queue: .main) {
|
||||
self.voiceBroadcastService?.sendChunkOfVoiceBroadcast(audioFileLocalURL: convertedUrl,
|
||||
@@ -212,11 +215,12 @@ class VoiceBroadcastRecorderService: VoiceBroadcastRecorderServiceProtocol {
|
||||
samples: nil,
|
||||
sequence: UInt(sequence)) { eventId in
|
||||
MXLog.debug("[VoiceBroadcastRecorderService] Send voice broadcast chunk with success.")
|
||||
if eventId != nil {
|
||||
self.deleteRecording(at: url)
|
||||
}
|
||||
self.deleteRecording(at: convertedUrl)
|
||||
} failure: { error in
|
||||
MXLog.error("[VoiceBroadcastRecorderService] Failed to send voice broadcast chunk.", context: error)
|
||||
// Do not delete the file to be sent if request failed, the retry flow will need it
|
||||
// There's no manual mechanism to clean it up afterwards but the tmp folder
|
||||
// they live in will eventually be deleted by the system
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user