Implements #745, #746, #747 - Initial media uploading flows

- room composer contextual menu for selecting source
- coordinator for presenting the different sources
- system picker handling and URL passback
- file preview after selection
- feature flag
This commit is contained in:
Stefan Ceriu
2023-03-28 17:47:34 +03:00
committed by Stefan Ceriu
parent 2359910857
commit 5f6edacc1a
27 changed files with 787 additions and 29 deletions
@@ -31,4 +31,21 @@ extension FileManager {
}
try createDirectory(at: url, withIntermediateDirectories: withIntermediateDirectories)
}
func copyFileToTemporaryLocation(url: URL) throws -> URL {
let newURL = URL.temporaryDirectory.appendingPathComponent(url.lastPathComponent)
try? removeItem(at: newURL)
try copyItem(at: url, to: newURL)
return newURL
}
func writeDataToTemporaryLocation(data: Data, fileName: String) throws -> URL {
let newURL = URL.temporaryDirectory.appendingPathComponent(fileName)
try data.write(to: newURL)
return newURL
}
}