Transition voice messages to the new in thread sending mechanism

This commit is contained in:
Stefan Ceriu
2025-07-22 10:41:30 +03:00
committed by Stefan Ceriu
parent ed98f64a35
commit 3fcbc8c60a
8 changed files with 76 additions and 69 deletions
@@ -145,6 +145,8 @@ class TimelineController: TimelineControllerProtocol {
func processItemDisappearance(_ itemID: TimelineItemIdentifier) { }
// MARK: - Sending
func sendMessage(_ message: String,
html: String?,
inReplyToEventID: String?,
@@ -153,7 +155,6 @@ class TimelineController: TimelineControllerProtocol {
switch await activeTimeline.sendMessage(message,
html: html,
threadRootEventID: timelineKind.threadRootEventID,
inReplyToEventID: inReplyToEventID,
intentionalMentions: intentionalMentions) {
case .success:
@@ -164,6 +165,12 @@ class TimelineController: TimelineControllerProtocol {
}
}
func sendVoiceMessage(url: URL, audioInfo: AudioInfo, waveform: [UInt16]) async -> Result<Void, TimelineProxyError> {
await activeTimeline.sendVoiceMessage(url: url,
audioInfo: audioInfo,
waveform: waveform) { _ in }
}
private func donateSendMessageIntent() async {
guard let displayName = roomProxy.details.name ?? roomProxy.details.canonicalAlias, !displayName.isEmpty else {
MXLog.error("Failed donating send message intent, room missing name or alias.")