Do not delete voice message file to be able to resend.

This commit is contained in:
Onuray Sahin 2021-10-11 16:49:15 +03:00
parent 3a387c5e32
commit 13aee7d162
3 changed files with 6 additions and 2 deletions

1
changelog.d/4006.bugfix Normal file
View File

@ -0,0 +1 @@
Voice Message not sendable if recorded while flight mode was on

View File

@ -291,6 +291,11 @@ internal class UploadContentWorker(val context: Context, params: WorkerParameter
filesToDelete.forEach {
tryOrNull { it.delete() }
}
// Delete the temporary voice message file
if (params.attachment.type == ContentAttachmentData.Type.AUDIO && params.attachment.mimeType == MimeTypes.Ogg) {
context.contentResolver.delete(params.attachment.queryUri, null, null)
}
}
}

View File

@ -1095,8 +1095,6 @@ class RoomDetailFragment @Inject constructor(
textComposerViewModel.handle(TextComposerAction.SaveDraft(views.composerLayout.text.toString()))
// We should improve the UX to support going into playback mode when paused and delete the media when the view is destroyed.
roomDetailViewModel.handle(RoomDetailAction.EndAllVoiceActions)
views.voiceMessageRecorderView.initVoiceRecordingViews()
}