Support gif uploads!

Changelog-Added: Added support for gif uploads
Closes: #827
This commit is contained in:
Swift
2023-03-29 00:59:19 -04:00
committed by William Casarin
parent b0aac1fc42
commit 5a238502cb
2 changed files with 40 additions and 24 deletions

View File

@@ -10,8 +10,21 @@ import UIKit
enum MediaUpload {
case image(UIImage)
case image(URL)
case video(URL)
var genericFileName: String {
"damus_generic_filename.\(file_extension)"
}
var file_extension: String {
switch self {
case .image(let url):
return url.pathExtension
case .video(let url):
return url.pathExtension
}
}
var is_image: Bool {
if case .image = self {