diff --git a/ElementX/Resources/Localizations/en.lproj/Localizable.strings b/ElementX/Resources/Localizations/en.lproj/Localizable.strings index 18d852607c..9abc9ec077 100644 --- a/ElementX/Resources/Localizations/en.lproj/Localizable.strings +++ b/ElementX/Resources/Localizations/en.lproj/Localizable.strings @@ -352,7 +352,7 @@ "rich_text_editor_unindent" = "Unindent"; "rich_text_editor_url_placeholder" = "Link"; "rich_text_editor_a11y_add_attachment" = "Add attachment"; -"rich_text_editor_composer_caption_placeholder" = "Optional caption…"; +"rich_text_editor_composer_caption_placeholder" = "Add a caption"; "screen_advanced_settings_element_call_base_url" = "Custom Element Call base URL"; "screen_advanced_settings_element_call_base_url_description" = "Set a custom base URL for Element Call."; "screen_advanced_settings_element_call_base_url_validation_error" = "Invalid URL, please make sure you include the protocol (http/https) and the correct address."; diff --git a/ElementX/Sources/Generated/Strings.swift b/ElementX/Sources/Generated/Strings.swift index 26487abd95..cb7e231c6d 100644 --- a/ElementX/Sources/Generated/Strings.swift +++ b/ElementX/Sources/Generated/Strings.swift @@ -796,7 +796,7 @@ internal enum L10n { internal static var richTextEditorCloseFormattingOptions: String { return L10n.tr("Localizable", "rich_text_editor_close_formatting_options") } /// Toggle code block internal static var richTextEditorCodeBlock: String { return L10n.tr("Localizable", "rich_text_editor_code_block") } - /// Optional caption… + /// Add a caption internal static var richTextEditorComposerCaptionPlaceholder: String { return L10n.tr("Localizable", "rich_text_editor_composer_caption_placeholder") } /// Message… internal static var richTextEditorComposerPlaceholder: String { return L10n.tr("Localizable", "rich_text_editor_composer_placeholder") } diff --git a/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift b/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift index ef2b2f793a..576eff68fd 100644 --- a/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift +++ b/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift @@ -14114,15 +14114,15 @@ class TimelineProxyMock: TimelineProxyProtocol { } //MARK: - sendAudio - var sendAudioUrlAudioInfoCaptionProgressSubjectRequestHandleUnderlyingCallsCount = 0 - var sendAudioUrlAudioInfoCaptionProgressSubjectRequestHandleCallsCount: Int { + var sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingCallsCount = 0 + var sendAudioUrlAudioInfoCaptionRequestHandleCallsCount: Int { get { if Thread.isMainThread { - return sendAudioUrlAudioInfoCaptionProgressSubjectRequestHandleUnderlyingCallsCount + return sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingCallsCount } else { var returnValue: Int? = nil DispatchQueue.main.sync { - returnValue = sendAudioUrlAudioInfoCaptionProgressSubjectRequestHandleUnderlyingCallsCount + returnValue = sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingCallsCount } return returnValue! @@ -14130,27 +14130,27 @@ class TimelineProxyMock: TimelineProxyProtocol { } set { if Thread.isMainThread { - sendAudioUrlAudioInfoCaptionProgressSubjectRequestHandleUnderlyingCallsCount = newValue + sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingCallsCount = newValue } else { DispatchQueue.main.sync { - sendAudioUrlAudioInfoCaptionProgressSubjectRequestHandleUnderlyingCallsCount = newValue + sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingCallsCount = newValue } } } } - var sendAudioUrlAudioInfoCaptionProgressSubjectRequestHandleCalled: Bool { - return sendAudioUrlAudioInfoCaptionProgressSubjectRequestHandleCallsCount > 0 + var sendAudioUrlAudioInfoCaptionRequestHandleCalled: Bool { + return sendAudioUrlAudioInfoCaptionRequestHandleCallsCount > 0 } - var sendAudioUrlAudioInfoCaptionProgressSubjectRequestHandleUnderlyingReturnValue: Result! - var sendAudioUrlAudioInfoCaptionProgressSubjectRequestHandleReturnValue: Result! { + var sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingReturnValue: Result! + var sendAudioUrlAudioInfoCaptionRequestHandleReturnValue: Result! { get { if Thread.isMainThread { - return sendAudioUrlAudioInfoCaptionProgressSubjectRequestHandleUnderlyingReturnValue + return sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingReturnValue } else { var returnValue: Result? = nil DispatchQueue.main.sync { - returnValue = sendAudioUrlAudioInfoCaptionProgressSubjectRequestHandleUnderlyingReturnValue + returnValue = sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingReturnValue } return returnValue! @@ -14158,35 +14158,35 @@ class TimelineProxyMock: TimelineProxyProtocol { } set { if Thread.isMainThread { - sendAudioUrlAudioInfoCaptionProgressSubjectRequestHandleUnderlyingReturnValue = newValue + sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingReturnValue = newValue } else { DispatchQueue.main.sync { - sendAudioUrlAudioInfoCaptionProgressSubjectRequestHandleUnderlyingReturnValue = newValue + sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingReturnValue = newValue } } } } - var sendAudioUrlAudioInfoCaptionProgressSubjectRequestHandleClosure: ((URL, AudioInfo, String?, CurrentValueSubject?, @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? + var sendAudioUrlAudioInfoCaptionRequestHandleClosure: ((URL, AudioInfo, String?, @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? - func sendAudio(url: URL, audioInfo: AudioInfo, caption: String?, progressSubject: CurrentValueSubject?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { - sendAudioUrlAudioInfoCaptionProgressSubjectRequestHandleCallsCount += 1 - if let sendAudioUrlAudioInfoCaptionProgressSubjectRequestHandleClosure = sendAudioUrlAudioInfoCaptionProgressSubjectRequestHandleClosure { - return await sendAudioUrlAudioInfoCaptionProgressSubjectRequestHandleClosure(url, audioInfo, caption, progressSubject, requestHandle) + func sendAudio(url: URL, audioInfo: AudioInfo, caption: String?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { + sendAudioUrlAudioInfoCaptionRequestHandleCallsCount += 1 + if let sendAudioUrlAudioInfoCaptionRequestHandleClosure = sendAudioUrlAudioInfoCaptionRequestHandleClosure { + return await sendAudioUrlAudioInfoCaptionRequestHandleClosure(url, audioInfo, caption, requestHandle) } else { - return sendAudioUrlAudioInfoCaptionProgressSubjectRequestHandleReturnValue + return sendAudioUrlAudioInfoCaptionRequestHandleReturnValue } } //MARK: - sendFile - var sendFileUrlFileInfoCaptionProgressSubjectRequestHandleUnderlyingCallsCount = 0 - var sendFileUrlFileInfoCaptionProgressSubjectRequestHandleCallsCount: Int { + var sendFileUrlFileInfoCaptionRequestHandleUnderlyingCallsCount = 0 + var sendFileUrlFileInfoCaptionRequestHandleCallsCount: Int { get { if Thread.isMainThread { - return sendFileUrlFileInfoCaptionProgressSubjectRequestHandleUnderlyingCallsCount + return sendFileUrlFileInfoCaptionRequestHandleUnderlyingCallsCount } else { var returnValue: Int? = nil DispatchQueue.main.sync { - returnValue = sendFileUrlFileInfoCaptionProgressSubjectRequestHandleUnderlyingCallsCount + returnValue = sendFileUrlFileInfoCaptionRequestHandleUnderlyingCallsCount } return returnValue! @@ -14194,27 +14194,27 @@ class TimelineProxyMock: TimelineProxyProtocol { } set { if Thread.isMainThread { - sendFileUrlFileInfoCaptionProgressSubjectRequestHandleUnderlyingCallsCount = newValue + sendFileUrlFileInfoCaptionRequestHandleUnderlyingCallsCount = newValue } else { DispatchQueue.main.sync { - sendFileUrlFileInfoCaptionProgressSubjectRequestHandleUnderlyingCallsCount = newValue + sendFileUrlFileInfoCaptionRequestHandleUnderlyingCallsCount = newValue } } } } - var sendFileUrlFileInfoCaptionProgressSubjectRequestHandleCalled: Bool { - return sendFileUrlFileInfoCaptionProgressSubjectRequestHandleCallsCount > 0 + var sendFileUrlFileInfoCaptionRequestHandleCalled: Bool { + return sendFileUrlFileInfoCaptionRequestHandleCallsCount > 0 } - var sendFileUrlFileInfoCaptionProgressSubjectRequestHandleUnderlyingReturnValue: Result! - var sendFileUrlFileInfoCaptionProgressSubjectRequestHandleReturnValue: Result! { + var sendFileUrlFileInfoCaptionRequestHandleUnderlyingReturnValue: Result! + var sendFileUrlFileInfoCaptionRequestHandleReturnValue: Result! { get { if Thread.isMainThread { - return sendFileUrlFileInfoCaptionProgressSubjectRequestHandleUnderlyingReturnValue + return sendFileUrlFileInfoCaptionRequestHandleUnderlyingReturnValue } else { var returnValue: Result? = nil DispatchQueue.main.sync { - returnValue = sendFileUrlFileInfoCaptionProgressSubjectRequestHandleUnderlyingReturnValue + returnValue = sendFileUrlFileInfoCaptionRequestHandleUnderlyingReturnValue } return returnValue! @@ -14222,35 +14222,35 @@ class TimelineProxyMock: TimelineProxyProtocol { } set { if Thread.isMainThread { - sendFileUrlFileInfoCaptionProgressSubjectRequestHandleUnderlyingReturnValue = newValue + sendFileUrlFileInfoCaptionRequestHandleUnderlyingReturnValue = newValue } else { DispatchQueue.main.sync { - sendFileUrlFileInfoCaptionProgressSubjectRequestHandleUnderlyingReturnValue = newValue + sendFileUrlFileInfoCaptionRequestHandleUnderlyingReturnValue = newValue } } } } - var sendFileUrlFileInfoCaptionProgressSubjectRequestHandleClosure: ((URL, FileInfo, String?, CurrentValueSubject?, @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? + var sendFileUrlFileInfoCaptionRequestHandleClosure: ((URL, FileInfo, String?, @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? - func sendFile(url: URL, fileInfo: FileInfo, caption: String?, progressSubject: CurrentValueSubject?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { - sendFileUrlFileInfoCaptionProgressSubjectRequestHandleCallsCount += 1 - if let sendFileUrlFileInfoCaptionProgressSubjectRequestHandleClosure = sendFileUrlFileInfoCaptionProgressSubjectRequestHandleClosure { - return await sendFileUrlFileInfoCaptionProgressSubjectRequestHandleClosure(url, fileInfo, caption, progressSubject, requestHandle) + func sendFile(url: URL, fileInfo: FileInfo, caption: String?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { + sendFileUrlFileInfoCaptionRequestHandleCallsCount += 1 + if let sendFileUrlFileInfoCaptionRequestHandleClosure = sendFileUrlFileInfoCaptionRequestHandleClosure { + return await sendFileUrlFileInfoCaptionRequestHandleClosure(url, fileInfo, caption, requestHandle) } else { - return sendFileUrlFileInfoCaptionProgressSubjectRequestHandleReturnValue + return sendFileUrlFileInfoCaptionRequestHandleReturnValue } } //MARK: - sendImage - var sendImageUrlThumbnailURLImageInfoCaptionProgressSubjectRequestHandleUnderlyingCallsCount = 0 - var sendImageUrlThumbnailURLImageInfoCaptionProgressSubjectRequestHandleCallsCount: Int { + var sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingCallsCount = 0 + var sendImageUrlThumbnailURLImageInfoCaptionRequestHandleCallsCount: Int { get { if Thread.isMainThread { - return sendImageUrlThumbnailURLImageInfoCaptionProgressSubjectRequestHandleUnderlyingCallsCount + return sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingCallsCount } else { var returnValue: Int? = nil DispatchQueue.main.sync { - returnValue = sendImageUrlThumbnailURLImageInfoCaptionProgressSubjectRequestHandleUnderlyingCallsCount + returnValue = sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingCallsCount } return returnValue! @@ -14258,27 +14258,27 @@ class TimelineProxyMock: TimelineProxyProtocol { } set { if Thread.isMainThread { - sendImageUrlThumbnailURLImageInfoCaptionProgressSubjectRequestHandleUnderlyingCallsCount = newValue + sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingCallsCount = newValue } else { DispatchQueue.main.sync { - sendImageUrlThumbnailURLImageInfoCaptionProgressSubjectRequestHandleUnderlyingCallsCount = newValue + sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingCallsCount = newValue } } } } - var sendImageUrlThumbnailURLImageInfoCaptionProgressSubjectRequestHandleCalled: Bool { - return sendImageUrlThumbnailURLImageInfoCaptionProgressSubjectRequestHandleCallsCount > 0 + var sendImageUrlThumbnailURLImageInfoCaptionRequestHandleCalled: Bool { + return sendImageUrlThumbnailURLImageInfoCaptionRequestHandleCallsCount > 0 } - var sendImageUrlThumbnailURLImageInfoCaptionProgressSubjectRequestHandleUnderlyingReturnValue: Result! - var sendImageUrlThumbnailURLImageInfoCaptionProgressSubjectRequestHandleReturnValue: Result! { + var sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingReturnValue: Result! + var sendImageUrlThumbnailURLImageInfoCaptionRequestHandleReturnValue: Result! { get { if Thread.isMainThread { - return sendImageUrlThumbnailURLImageInfoCaptionProgressSubjectRequestHandleUnderlyingReturnValue + return sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingReturnValue } else { var returnValue: Result? = nil DispatchQueue.main.sync { - returnValue = sendImageUrlThumbnailURLImageInfoCaptionProgressSubjectRequestHandleUnderlyingReturnValue + returnValue = sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingReturnValue } return returnValue! @@ -14286,22 +14286,22 @@ class TimelineProxyMock: TimelineProxyProtocol { } set { if Thread.isMainThread { - sendImageUrlThumbnailURLImageInfoCaptionProgressSubjectRequestHandleUnderlyingReturnValue = newValue + sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingReturnValue = newValue } else { DispatchQueue.main.sync { - sendImageUrlThumbnailURLImageInfoCaptionProgressSubjectRequestHandleUnderlyingReturnValue = newValue + sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingReturnValue = newValue } } } } - var sendImageUrlThumbnailURLImageInfoCaptionProgressSubjectRequestHandleClosure: ((URL, URL, ImageInfo, String?, CurrentValueSubject?, @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? + var sendImageUrlThumbnailURLImageInfoCaptionRequestHandleClosure: ((URL, URL, ImageInfo, String?, @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? - func sendImage(url: URL, thumbnailURL: URL, imageInfo: ImageInfo, caption: String?, progressSubject: CurrentValueSubject?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { - sendImageUrlThumbnailURLImageInfoCaptionProgressSubjectRequestHandleCallsCount += 1 - if let sendImageUrlThumbnailURLImageInfoCaptionProgressSubjectRequestHandleClosure = sendImageUrlThumbnailURLImageInfoCaptionProgressSubjectRequestHandleClosure { - return await sendImageUrlThumbnailURLImageInfoCaptionProgressSubjectRequestHandleClosure(url, thumbnailURL, imageInfo, caption, progressSubject, requestHandle) + func sendImage(url: URL, thumbnailURL: URL, imageInfo: ImageInfo, caption: String?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { + sendImageUrlThumbnailURLImageInfoCaptionRequestHandleCallsCount += 1 + if let sendImageUrlThumbnailURLImageInfoCaptionRequestHandleClosure = sendImageUrlThumbnailURLImageInfoCaptionRequestHandleClosure { + return await sendImageUrlThumbnailURLImageInfoCaptionRequestHandleClosure(url, thumbnailURL, imageInfo, caption, requestHandle) } else { - return sendImageUrlThumbnailURLImageInfoCaptionProgressSubjectRequestHandleReturnValue + return sendImageUrlThumbnailURLImageInfoCaptionRequestHandleReturnValue } } //MARK: - sendLocation @@ -14376,15 +14376,15 @@ class TimelineProxyMock: TimelineProxyProtocol { } //MARK: - sendVideo - var sendVideoUrlThumbnailURLVideoInfoCaptionProgressSubjectRequestHandleUnderlyingCallsCount = 0 - var sendVideoUrlThumbnailURLVideoInfoCaptionProgressSubjectRequestHandleCallsCount: Int { + var sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingCallsCount = 0 + var sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleCallsCount: Int { get { if Thread.isMainThread { - return sendVideoUrlThumbnailURLVideoInfoCaptionProgressSubjectRequestHandleUnderlyingCallsCount + return sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingCallsCount } else { var returnValue: Int? = nil DispatchQueue.main.sync { - returnValue = sendVideoUrlThumbnailURLVideoInfoCaptionProgressSubjectRequestHandleUnderlyingCallsCount + returnValue = sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingCallsCount } return returnValue! @@ -14392,27 +14392,27 @@ class TimelineProxyMock: TimelineProxyProtocol { } set { if Thread.isMainThread { - sendVideoUrlThumbnailURLVideoInfoCaptionProgressSubjectRequestHandleUnderlyingCallsCount = newValue + sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingCallsCount = newValue } else { DispatchQueue.main.sync { - sendVideoUrlThumbnailURLVideoInfoCaptionProgressSubjectRequestHandleUnderlyingCallsCount = newValue + sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingCallsCount = newValue } } } } - var sendVideoUrlThumbnailURLVideoInfoCaptionProgressSubjectRequestHandleCalled: Bool { - return sendVideoUrlThumbnailURLVideoInfoCaptionProgressSubjectRequestHandleCallsCount > 0 + var sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleCalled: Bool { + return sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleCallsCount > 0 } - var sendVideoUrlThumbnailURLVideoInfoCaptionProgressSubjectRequestHandleUnderlyingReturnValue: Result! - var sendVideoUrlThumbnailURLVideoInfoCaptionProgressSubjectRequestHandleReturnValue: Result! { + var sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingReturnValue: Result! + var sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleReturnValue: Result! { get { if Thread.isMainThread { - return sendVideoUrlThumbnailURLVideoInfoCaptionProgressSubjectRequestHandleUnderlyingReturnValue + return sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingReturnValue } else { var returnValue: Result? = nil DispatchQueue.main.sync { - returnValue = sendVideoUrlThumbnailURLVideoInfoCaptionProgressSubjectRequestHandleUnderlyingReturnValue + returnValue = sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingReturnValue } return returnValue! @@ -14420,35 +14420,35 @@ class TimelineProxyMock: TimelineProxyProtocol { } set { if Thread.isMainThread { - sendVideoUrlThumbnailURLVideoInfoCaptionProgressSubjectRequestHandleUnderlyingReturnValue = newValue + sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingReturnValue = newValue } else { DispatchQueue.main.sync { - sendVideoUrlThumbnailURLVideoInfoCaptionProgressSubjectRequestHandleUnderlyingReturnValue = newValue + sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingReturnValue = newValue } } } } - var sendVideoUrlThumbnailURLVideoInfoCaptionProgressSubjectRequestHandleClosure: ((URL, URL, VideoInfo, String?, CurrentValueSubject?, @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? + var sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleClosure: ((URL, URL, VideoInfo, String?, @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? - func sendVideo(url: URL, thumbnailURL: URL, videoInfo: VideoInfo, caption: String?, progressSubject: CurrentValueSubject?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { - sendVideoUrlThumbnailURLVideoInfoCaptionProgressSubjectRequestHandleCallsCount += 1 - if let sendVideoUrlThumbnailURLVideoInfoCaptionProgressSubjectRequestHandleClosure = sendVideoUrlThumbnailURLVideoInfoCaptionProgressSubjectRequestHandleClosure { - return await sendVideoUrlThumbnailURLVideoInfoCaptionProgressSubjectRequestHandleClosure(url, thumbnailURL, videoInfo, caption, progressSubject, requestHandle) + func sendVideo(url: URL, thumbnailURL: URL, videoInfo: VideoInfo, caption: String?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { + sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleCallsCount += 1 + if let sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleClosure = sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleClosure { + return await sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleClosure(url, thumbnailURL, videoInfo, caption, requestHandle) } else { - return sendVideoUrlThumbnailURLVideoInfoCaptionProgressSubjectRequestHandleReturnValue + return sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleReturnValue } } //MARK: - sendVoiceMessage - var sendVoiceMessageUrlAudioInfoWaveformProgressSubjectRequestHandleUnderlyingCallsCount = 0 - var sendVoiceMessageUrlAudioInfoWaveformProgressSubjectRequestHandleCallsCount: Int { + var sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingCallsCount = 0 + var sendVoiceMessageUrlAudioInfoWaveformRequestHandleCallsCount: Int { get { if Thread.isMainThread { - return sendVoiceMessageUrlAudioInfoWaveformProgressSubjectRequestHandleUnderlyingCallsCount + return sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingCallsCount } else { var returnValue: Int? = nil DispatchQueue.main.sync { - returnValue = sendVoiceMessageUrlAudioInfoWaveformProgressSubjectRequestHandleUnderlyingCallsCount + returnValue = sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingCallsCount } return returnValue! @@ -14456,27 +14456,27 @@ class TimelineProxyMock: TimelineProxyProtocol { } set { if Thread.isMainThread { - sendVoiceMessageUrlAudioInfoWaveformProgressSubjectRequestHandleUnderlyingCallsCount = newValue + sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingCallsCount = newValue } else { DispatchQueue.main.sync { - sendVoiceMessageUrlAudioInfoWaveformProgressSubjectRequestHandleUnderlyingCallsCount = newValue + sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingCallsCount = newValue } } } } - var sendVoiceMessageUrlAudioInfoWaveformProgressSubjectRequestHandleCalled: Bool { - return sendVoiceMessageUrlAudioInfoWaveformProgressSubjectRequestHandleCallsCount > 0 + var sendVoiceMessageUrlAudioInfoWaveformRequestHandleCalled: Bool { + return sendVoiceMessageUrlAudioInfoWaveformRequestHandleCallsCount > 0 } - var sendVoiceMessageUrlAudioInfoWaveformProgressSubjectRequestHandleUnderlyingReturnValue: Result! - var sendVoiceMessageUrlAudioInfoWaveformProgressSubjectRequestHandleReturnValue: Result! { + var sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingReturnValue: Result! + var sendVoiceMessageUrlAudioInfoWaveformRequestHandleReturnValue: Result! { get { if Thread.isMainThread { - return sendVoiceMessageUrlAudioInfoWaveformProgressSubjectRequestHandleUnderlyingReturnValue + return sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingReturnValue } else { var returnValue: Result? = nil DispatchQueue.main.sync { - returnValue = sendVoiceMessageUrlAudioInfoWaveformProgressSubjectRequestHandleUnderlyingReturnValue + returnValue = sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingReturnValue } return returnValue! @@ -14484,22 +14484,22 @@ class TimelineProxyMock: TimelineProxyProtocol { } set { if Thread.isMainThread { - sendVoiceMessageUrlAudioInfoWaveformProgressSubjectRequestHandleUnderlyingReturnValue = newValue + sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingReturnValue = newValue } else { DispatchQueue.main.sync { - sendVoiceMessageUrlAudioInfoWaveformProgressSubjectRequestHandleUnderlyingReturnValue = newValue + sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingReturnValue = newValue } } } } - var sendVoiceMessageUrlAudioInfoWaveformProgressSubjectRequestHandleClosure: ((URL, AudioInfo, [UInt16], CurrentValueSubject?, @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? + var sendVoiceMessageUrlAudioInfoWaveformRequestHandleClosure: ((URL, AudioInfo, [UInt16], @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? - func sendVoiceMessage(url: URL, audioInfo: AudioInfo, waveform: [UInt16], progressSubject: CurrentValueSubject?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { - sendVoiceMessageUrlAudioInfoWaveformProgressSubjectRequestHandleCallsCount += 1 - if let sendVoiceMessageUrlAudioInfoWaveformProgressSubjectRequestHandleClosure = sendVoiceMessageUrlAudioInfoWaveformProgressSubjectRequestHandleClosure { - return await sendVoiceMessageUrlAudioInfoWaveformProgressSubjectRequestHandleClosure(url, audioInfo, waveform, progressSubject, requestHandle) + func sendVoiceMessage(url: URL, audioInfo: AudioInfo, waveform: [UInt16], requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { + sendVoiceMessageUrlAudioInfoWaveformRequestHandleCallsCount += 1 + if let sendVoiceMessageUrlAudioInfoWaveformRequestHandleClosure = sendVoiceMessageUrlAudioInfoWaveformRequestHandleClosure { + return await sendVoiceMessageUrlAudioInfoWaveformRequestHandleClosure(url, audioInfo, waveform, requestHandle) } else { - return sendVoiceMessageUrlAudioInfoWaveformProgressSubjectRequestHandleReturnValue + return sendVoiceMessageUrlAudioInfoWaveformRequestHandleReturnValue } } //MARK: - sendReadReceipt diff --git a/ElementX/Sources/Screens/MediaUploadPreviewScreen/MediaUploadPreviewScreenViewModel.swift b/ElementX/Sources/Screens/MediaUploadPreviewScreen/MediaUploadPreviewScreenViewModel.swift index f76a025c85..f3741f6e0b 100644 --- a/ElementX/Sources/Screens/MediaUploadPreviewScreen/MediaUploadPreviewScreenViewModel.swift +++ b/ElementX/Sources/Screens/MediaUploadPreviewScreen/MediaUploadPreviewScreenViewModel.swift @@ -49,13 +49,11 @@ class MediaUploadPreviewScreenViewModel: MediaUploadPreviewScreenViewModelType, switch viewAction { case .send: Task { - let progressSubject = AppSettings.isDevelopmentBuild ? nil : CurrentValueSubject(0.0) - - startLoading(progressPublisher: progressSubject?.asCurrentValuePublisher()) + startLoading() switch await mediaUploadingPreprocessor.processMedia(at: url) { case .success(let mediaInfo): - switch await sendAttachment(mediaInfo: mediaInfo, caption: caption, progressSubject: progressSubject) { + switch await sendAttachment(mediaInfo: mediaInfo, caption: caption) { case .success: actionsSubject.send(.dismiss) case .failure(let error): @@ -79,7 +77,7 @@ class MediaUploadPreviewScreenViewModel: MediaUploadPreviewScreenViewModelType, // MARK: - Private - private func sendAttachment(mediaInfo: MediaInfo, caption: String?, progressSubject: CurrentValueSubject?) async -> Result { + private func sendAttachment(mediaInfo: MediaInfo, caption: String?) async -> Result { let requestHandle: ((SendAttachmentJoinHandleProtocol) -> Void) = { [weak self] handle in self?.requestHandle = handle } @@ -90,42 +88,32 @@ class MediaUploadPreviewScreenViewModel: MediaUploadPreviewScreenViewModelType, thumbnailURL: thumbnailURL, imageInfo: imageInfo, caption: caption, - progressSubject: progressSubject, requestHandle: requestHandle) case let .video(videoURL, thumbnailURL, videoInfo): return await roomProxy.timeline.sendVideo(url: videoURL, thumbnailURL: thumbnailURL, videoInfo: videoInfo, caption: caption, - progressSubject: progressSubject, requestHandle: requestHandle) case let .audio(audioURL, audioInfo): return await roomProxy.timeline.sendAudio(url: audioURL, audioInfo: audioInfo, caption: caption, - progressSubject: progressSubject, requestHandle: requestHandle) case let .file(fileURL, fileInfo): return await roomProxy.timeline.sendFile(url: fileURL, fileInfo: fileInfo, caption: caption, - progressSubject: progressSubject, requestHandle: requestHandle) } } private static let loadingIndicatorIdentifier = "\(MediaUploadPreviewScreenViewModel.self)-Loading" - private func startLoading(progressPublisher: CurrentValuePublisher?) { - let progress: UserIndicator.Progress = if let progressPublisher { - .published(progressPublisher) - } else { - .indeterminate - } - + private func startLoading() { userIndicatorController.submitIndicator( UserIndicator(id: Self.loadingIndicatorIdentifier, - type: .modal(progress: progress, interactiveDismissDisabled: false, allowsInteraction: true), + type: .modal(progress: .indeterminate, interactiveDismissDisabled: false, allowsInteraction: true), title: L10n.commonSending, persistent: true) ) diff --git a/ElementX/Sources/Services/Timeline/TimelineProxy.swift b/ElementX/Sources/Services/Timeline/TimelineProxy.swift index 0c2422de17..93238d41ea 100644 --- a/ElementX/Sources/Services/Timeline/TimelineProxy.swift +++ b/ElementX/Sources/Services/Timeline/TimelineProxy.swift @@ -224,18 +224,15 @@ final class TimelineProxy: TimelineProxyProtocol { func sendAudio(url: URL, audioInfo: AudioInfo, caption: String?, - progressSubject: CurrentValueSubject?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { MXLog.info("Sending audio") let handle = timeline.sendAudio(url: url.path(percentEncoded: false), audioInfo: audioInfo, caption: caption, - formattedCaption: nil, - progressWatcher: UploadProgressListener { progress in - progressSubject?.send(progress) - }, - useSendQueue: AppSettings.isDevelopmentBuild) + formattedCaption: nil, // Rust will build this from the caption's markdown. + progressWatcher: nil, + useSendQueue: true) await requestHandle(handle) @@ -253,18 +250,15 @@ final class TimelineProxy: TimelineProxyProtocol { func sendFile(url: URL, fileInfo: FileInfo, caption: String?, - progressSubject: CurrentValueSubject?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { MXLog.info("Sending file") let handle = timeline.sendFile(url: url.path(percentEncoded: false), fileInfo: fileInfo, caption: caption, - formattedCaption: nil, - progressWatcher: UploadProgressListener { progress in - progressSubject?.send(progress) - }, - useSendQueue: AppSettings.isDevelopmentBuild) + formattedCaption: nil, // Rust will build this from the caption's markdown. + progressWatcher: nil, + useSendQueue: true) await requestHandle(handle) @@ -279,12 +273,10 @@ final class TimelineProxy: TimelineProxyProtocol { return .success(()) } - // swiftlint:disable:next function_parameter_count func sendImage(url: URL, thumbnailURL: URL, imageInfo: ImageInfo, caption: String?, - progressSubject: CurrentValueSubject?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { MXLog.info("Sending image") @@ -292,11 +284,9 @@ final class TimelineProxy: TimelineProxyProtocol { thumbnailUrl: thumbnailURL.path(percentEncoded: false), imageInfo: imageInfo, caption: caption, - formattedCaption: nil, - progressWatcher: UploadProgressListener { progress in - progressSubject?.send(progress) - }, - useSendQueue: AppSettings.isDevelopmentBuild) + formattedCaption: nil, // Rust will build this from the caption's markdown. + progressWatcher: nil, + useSendQueue: true) await requestHandle(handle) @@ -334,7 +324,6 @@ final class TimelineProxy: TimelineProxyProtocol { thumbnailURL: URL, videoInfo: VideoInfo, caption: String?, - progressSubject: CurrentValueSubject?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { MXLog.info("Sending video") @@ -342,11 +331,9 @@ final class TimelineProxy: TimelineProxyProtocol { thumbnailUrl: thumbnailURL.path(percentEncoded: false), videoInfo: videoInfo, caption: caption, - formattedCaption: nil, - progressWatcher: UploadProgressListener { progress in - progressSubject?.send(progress) - }, - useSendQueue: AppSettings.isDevelopmentBuild) + formattedCaption: nil, // Rust will build this from the caption's markdown. + progressWatcher: nil, + useSendQueue: true) await requestHandle(handle) @@ -364,7 +351,6 @@ final class TimelineProxy: TimelineProxyProtocol { func sendVoiceMessage(url: URL, audioInfo: AudioInfo, waveform: [UInt16], - progressSubject: CurrentValueSubject?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { MXLog.info("Sending voice message") @@ -373,10 +359,8 @@ final class TimelineProxy: TimelineProxyProtocol { waveform: waveform, caption: nil, formattedCaption: nil, - progressWatcher: UploadProgressListener { progress in - progressSubject?.send(progress) - }, - useSendQueue: AppSettings.isDevelopmentBuild) + progressWatcher: nil, + useSendQueue: true) await requestHandle(handle) diff --git a/ElementX/Sources/Services/Timeline/TimelineProxyProtocol.swift b/ElementX/Sources/Services/Timeline/TimelineProxyProtocol.swift index 3bff76ecba..d1520cbbeb 100644 --- a/ElementX/Sources/Services/Timeline/TimelineProxyProtocol.swift +++ b/ElementX/Sources/Services/Timeline/TimelineProxyProtocol.swift @@ -52,21 +52,17 @@ protocol TimelineProxyProtocol { func sendAudio(url: URL, audioInfo: AudioInfo, caption: String?, - progressSubject: CurrentValueSubject?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result func sendFile(url: URL, fileInfo: FileInfo, caption: String?, - progressSubject: CurrentValueSubject?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result - // swiftlint:disable:next function_parameter_count func sendImage(url: URL, thumbnailURL: URL, imageInfo: ImageInfo, caption: String?, - progressSubject: CurrentValueSubject?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result func sendLocation(body: String, @@ -75,18 +71,15 @@ protocol TimelineProxyProtocol { zoomLevel: UInt8?, assetType: AssetType?) async -> Result - // swiftlint:disable:next function_parameter_count func sendVideo(url: URL, thumbnailURL: URL, videoInfo: VideoInfo, caption: String?, - progressSubject: CurrentValueSubject?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result func sendVoiceMessage(url: URL, audioInfo: AudioInfo, waveform: [UInt16], - progressSubject: CurrentValueSubject?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result func sendReadReceipt(for eventID: String, type: ReceiptType) async -> Result diff --git a/ElementX/Sources/Services/VoiceMessage/VoiceMessageRecorder.swift b/ElementX/Sources/Services/VoiceMessage/VoiceMessageRecorder.swift index 55f5f8769b..cd9e14f329 100644 --- a/ElementX/Sources/Services/VoiceMessage/VoiceMessageRecorder.swift +++ b/ElementX/Sources/Services/VoiceMessage/VoiceMessageRecorder.swift @@ -178,8 +178,7 @@ class VoiceMessageRecorder: VoiceMessageRecorderProtocol { let result = await roomProxy.timeline.sendVoiceMessage(url: oggFile, audioInfo: audioInfo, - waveform: waveform, - progressSubject: nil) { _ in } + waveform: waveform) { _ in } if case .failure(let error) = result { MXLog.error("Failed to send the voice message. \(error)") diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_mediaUploadPreviewScreen-iPad-en-GB.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_mediaUploadPreviewScreen-iPad-en-GB.1.png index d9424a3003..480ef09fe2 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_mediaUploadPreviewScreen-iPad-en-GB.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_mediaUploadPreviewScreen-iPad-en-GB.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:79c2656c58dde4df7af57a9ce1561d33c83772a8f15e88ea57fe80f8c14b61b5 -size 92652 +oid sha256:742693f46cc68c183a0996ef9dd008feb93637ac548db45f202485dc3e8a6849 +size 92357 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_mediaUploadPreviewScreen-iPad-pseudo.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_mediaUploadPreviewScreen-iPad-pseudo.1.png index 377fe1b2b7..1383459ef5 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_mediaUploadPreviewScreen-iPad-pseudo.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_mediaUploadPreviewScreen-iPad-pseudo.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f53cf59f991c8958e8ae06759f05cf41b39ec6d1b402fcc6123edbd54e863409 -size 93837 +oid sha256:725f841b450a1246120002770a578df844c3674c3dd782fea8f284f451df408e +size 93411 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_mediaUploadPreviewScreen-iPhone-16-en-GB.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_mediaUploadPreviewScreen-iPhone-16-en-GB.1.png index b77d39bca7..9f1fb6b938 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_mediaUploadPreviewScreen-iPhone-16-en-GB.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_mediaUploadPreviewScreen-iPhone-16-en-GB.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1212f7afafd62561d7a90852e077667a042d4e86bd9b572904e0c89146e8d8b9 -size 51188 +oid sha256:e2689c49be718d18370c01e0fbcf67a77c358a057a9d6a6d7627930072c22d2e +size 50886 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_mediaUploadPreviewScreen-iPhone-16-pseudo.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_mediaUploadPreviewScreen-iPhone-16-pseudo.1.png index 3bf2bb188f..a178888568 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_mediaUploadPreviewScreen-iPhone-16-pseudo.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_mediaUploadPreviewScreen-iPhone-16-pseudo.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f6ac82c8457a7771ae7c30049ea4250f434285e4ae15ad52eefc935bd38e37eb -size 51942 +oid sha256:2a0cfc0ced4f4ab9bf6944b82217e1ed46f54d2aa2d358d040aa8c67f4a24074 +size 51725 diff --git a/UnitTests/Sources/MediaUploadPreviewScreenViewModelTests.swift b/UnitTests/Sources/MediaUploadPreviewScreenViewModelTests.swift index 7fe56df9de..81218b0311 100644 --- a/UnitTests/Sources/MediaUploadPreviewScreenViewModelTests.swift +++ b/UnitTests/Sources/MediaUploadPreviewScreenViewModelTests.swift @@ -106,16 +106,16 @@ class MediaUploadPreviewScreenViewModelTests: XCTestCase { private func setUpViewModel(url: URL, expectedCaption: String?) { timelineProxy = TimelineProxyMock(.init()) - timelineProxy.sendAudioUrlAudioInfoCaptionProgressSubjectRequestHandleClosure = { [weak self] _, _, caption, _, _ in + timelineProxy.sendAudioUrlAudioInfoCaptionRequestHandleClosure = { [weak self] _, _, caption, _ in self?.verifyCaption(caption, expectedCaption: expectedCaption) ?? .failure(.sdkError(TestError.unknown)) } - timelineProxy.sendFileUrlFileInfoCaptionProgressSubjectRequestHandleClosure = { [weak self] _, _, caption, _, _ in + timelineProxy.sendFileUrlFileInfoCaptionRequestHandleClosure = { [weak self] _, _, caption, _ in self?.verifyCaption(caption, expectedCaption: expectedCaption) ?? .failure(.sdkError(TestError.unknown)) } - timelineProxy.sendImageUrlThumbnailURLImageInfoCaptionProgressSubjectRequestHandleClosure = { [weak self] _, _, _, caption, _, _ in + timelineProxy.sendImageUrlThumbnailURLImageInfoCaptionRequestHandleClosure = { [weak self] _, _, _, caption, _ in self?.verifyCaption(caption, expectedCaption: expectedCaption) ?? .failure(.sdkError(TestError.unknown)) } - timelineProxy.sendVideoUrlThumbnailURLVideoInfoCaptionProgressSubjectRequestHandleClosure = { [weak self] _, _, _, caption, _, _ in + timelineProxy.sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleClosure = { [weak self] _, _, _, caption, _ in self?.verifyCaption(caption, expectedCaption: expectedCaption) ?? .failure(.sdkError(TestError.unknown)) } diff --git a/UnitTests/Sources/VoiceMessageRecorderTests.swift b/UnitTests/Sources/VoiceMessageRecorderTests.swift index a3c675c88f..57e45a1a2f 100644 --- a/UnitTests/Sources/VoiceMessageRecorderTests.swift +++ b/UnitTests/Sources/VoiceMessageRecorderTests.swift @@ -227,7 +227,7 @@ class VoiceMessageRecorderTests: XCTestCase { let timelineProxy = TimelineProxyMock() let roomProxy = JoinedRoomProxyMock() roomProxy.timeline = timelineProxy - timelineProxy.sendVoiceMessageUrlAudioInfoWaveformProgressSubjectRequestHandleReturnValue = .failure(.sdkError(SDKError.generic)) + timelineProxy.sendVoiceMessageUrlAudioInfoWaveformRequestHandleReturnValue = .failure(.sdkError(SDKError.generic)) guard case .failure(.failedSendingVoiceMessage) = await voiceMessageRecorder.sendVoiceMessage(inRoom: roomProxy, audioConverter: audioConverter) else { XCTFail("An error is expected") return @@ -248,7 +248,7 @@ class VoiceMessageRecorderTests: XCTestCase { let timelineProxy = TimelineProxyMock() let roomProxy = JoinedRoomProxyMock() roomProxy.timeline = timelineProxy - timelineProxy.sendVoiceMessageUrlAudioInfoWaveformProgressSubjectRequestHandleReturnValue = .failure(.sdkError(SDKError.generic)) + timelineProxy.sendVoiceMessageUrlAudioInfoWaveformRequestHandleReturnValue = .failure(.sdkError(SDKError.generic)) guard case .failure(.failedSendingVoiceMessage) = await voiceMessageRecorder.sendVoiceMessage(inRoom: roomProxy, audioConverter: audioConverter) else { XCTFail("An error is expected") return @@ -271,7 +271,7 @@ class VoiceMessageRecorderTests: XCTestCase { let timelineProxy = TimelineProxyMock() let roomProxy = JoinedRoomProxyMock() roomProxy.timeline = timelineProxy - timelineProxy.sendVoiceMessageUrlAudioInfoWaveformProgressSubjectRequestHandleReturnValue = .failure(.sdkError(SDKError.generic)) + timelineProxy.sendVoiceMessageUrlAudioInfoWaveformRequestHandleReturnValue = .failure(.sdkError(SDKError.generic)) guard case .failure(.failedSendingVoiceMessage) = await voiceMessageRecorder.sendVoiceMessage(inRoom: roomProxy, audioConverter: audioConverter) else { XCTFail("An error is expected") return @@ -307,7 +307,7 @@ class VoiceMessageRecorderTests: XCTestCase { XCTAssertEqual(destination.pathExtension, "ogg") } - timelineProxy.sendVoiceMessageUrlAudioInfoWaveformProgressSubjectRequestHandleClosure = { url, audioInfo, waveform, _, _ in + timelineProxy.sendVoiceMessageUrlAudioInfoWaveformRequestHandleClosure = { url, audioInfo, waveform, _ in XCTAssertEqual(url, convertedFileURL) XCTAssertEqual(audioInfo.duration, self.audioRecorder.currentTime) XCTAssertEqual(audioInfo.size, convertedFileSize) @@ -323,7 +323,7 @@ class VoiceMessageRecorderTests: XCTestCase { } XCTAssert(audioConverter.convertToOpusOggSourceURLDestinationURLCalled) - XCTAssert(timelineProxy.sendVoiceMessageUrlAudioInfoWaveformProgressSubjectRequestHandleCalled) + XCTAssert(timelineProxy.sendVoiceMessageUrlAudioInfoWaveformRequestHandleCalled) // the converted file must have been deleted if let convertedFileURL {