mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 00:24:43 +02:00
Fixes #4970 - Fixed unintentional voice message drafts on automatically cancelled recordings.
This commit is contained in:
committed by
Stefan Ceriu
parent
8937a13937
commit
2e1ff54773
@@ -130,12 +130,7 @@ public class VoiceMessageController: NSObject, VoiceMessageToolbarViewDelegate,
|
||||
}
|
||||
|
||||
func voiceMessageToolbarViewDidRequestRecordingCancel(_ toolbarView: VoiceMessageToolbarView) {
|
||||
isInLockedMode = false
|
||||
audioPlayer?.stop()
|
||||
audioRecorder?.stopRecording()
|
||||
deleteRecordingAtURL(temporaryFileURL)
|
||||
UINotificationFeedbackGenerator().notificationOccurred(.error)
|
||||
updateUI()
|
||||
cancelRecording()
|
||||
}
|
||||
|
||||
func voiceMessageToolbarViewDidRequestLockedModeRecording(_ toolbarView: VoiceMessageToolbarView) {
|
||||
@@ -259,6 +254,8 @@ public class VoiceMessageController: NSObject, VoiceMessageToolbarViewDelegate,
|
||||
guard isInLockedMode else {
|
||||
if recordDuration ?? 0 >= Constants.minimumRecordingDuration {
|
||||
sendRecordingAtURL(temporaryFileURL)
|
||||
} else {
|
||||
cancelRecording()
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -268,6 +265,19 @@ public class VoiceMessageController: NSObject, VoiceMessageToolbarViewDelegate,
|
||||
updateUI()
|
||||
}
|
||||
|
||||
private func cancelRecording() {
|
||||
isInLockedMode = false
|
||||
|
||||
audioPlayer?.stop()
|
||||
audioRecorder?.stopRecording()
|
||||
|
||||
deleteRecordingAtURL(temporaryFileURL)
|
||||
|
||||
UINotificationFeedbackGenerator().notificationOccurred(.error)
|
||||
|
||||
updateUI()
|
||||
}
|
||||
|
||||
private func loadDraftRecording() {
|
||||
guard let temporaryFileURL = temporaryFileURL,
|
||||
let roomId = roomId else {
|
||||
|
||||
Reference in New Issue
Block a user