mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
Pass attachment bodies when loading media
This commit is contained in:
committed by
Stefan Ceriu
parent
95492d7e10
commit
86aebfb9ef
@@ -91,12 +91,12 @@ struct MediaProvider: MediaProviderProtocol {
|
||||
|
||||
// MARK: Files
|
||||
|
||||
func loadFileFromSource(_ source: MediaSourceProxy) async -> Result<MediaFileHandleProxy, MediaProviderError> {
|
||||
func loadFileFromSource(_ source: MediaSourceProxy, body: String?) async -> Result<MediaFileHandleProxy, MediaProviderError> {
|
||||
let loadFileBgTask = await backgroundTaskService?.startBackgroundTask(withName: "LoadFile: \(source.url.hashValue)")
|
||||
defer { loadFileBgTask?.stop() }
|
||||
|
||||
do {
|
||||
let file = try await mediaLoader.loadMediaFileForSource(source)
|
||||
let file = try await mediaLoader.loadMediaFileForSource(source, body: body)
|
||||
return .success(file)
|
||||
} catch {
|
||||
MXLog.error("Failed retrieving file with error: \(error)")
|
||||
|
||||
Reference in New Issue
Block a user