Enable local echoes for media uploads for all builds. (#3579)

* Enable local echoes for media uploads for all builds.

* Update a string.
This commit is contained in:
Doug
2024-12-03 11:28:21 +00:00
committed by GitHub
parent 4372048c61
commit 4187155159
13 changed files with 139 additions and 175 deletions
@@ -224,18 +224,15 @@ final class TimelineProxy: TimelineProxyProtocol {
func sendAudio(url: URL,
audioInfo: AudioInfo,
caption: String?,
progressSubject: CurrentValueSubject<Double, Never>?,
requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result<Void, TimelineProxyError> {
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<Double, Never>?,
requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result<Void, TimelineProxyError> {
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<Double, Never>?,
requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result<Void, TimelineProxyError> {
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<Double, Never>?,
requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result<Void, TimelineProxyError> {
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<Double, Never>?,
requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result<Void, TimelineProxyError> {
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)
@@ -52,21 +52,17 @@ protocol TimelineProxyProtocol {
func sendAudio(url: URL,
audioInfo: AudioInfo,
caption: String?,
progressSubject: CurrentValueSubject<Double, Never>?,
requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result<Void, TimelineProxyError>
func sendFile(url: URL,
fileInfo: FileInfo,
caption: String?,
progressSubject: CurrentValueSubject<Double, Never>?,
requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result<Void, TimelineProxyError>
// swiftlint:disable:next function_parameter_count
func sendImage(url: URL,
thumbnailURL: URL,
imageInfo: ImageInfo,
caption: String?,
progressSubject: CurrentValueSubject<Double, Never>?,
requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result<Void, TimelineProxyError>
func sendLocation(body: String,
@@ -75,18 +71,15 @@ protocol TimelineProxyProtocol {
zoomLevel: UInt8?,
assetType: AssetType?) async -> Result<Void, TimelineProxyError>
// swiftlint:disable:next function_parameter_count
func sendVideo(url: URL,
thumbnailURL: URL,
videoInfo: VideoInfo,
caption: String?,
progressSubject: CurrentValueSubject<Double, Never>?,
requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result<Void, TimelineProxyError>
func sendVoiceMessage(url: URL,
audioInfo: AudioInfo,
waveform: [UInt16],
progressSubject: CurrentValueSubject<Double, Never>?,
requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result<Void, TimelineProxyError>
func sendReadReceipt(for eventID: String, type: ReceiptType) async -> Result<Void, TimelineProxyError>