mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
* #748 - Implement methods for processing various media types and preparing them for upload * Various tweaks following code review: - added blurhash generation - changed thumbnails to jpeg - throwing if file size cannot be retrieved - move MediaProvider files to separate folder so they can cleanly be imported in the NSE - added audio file processing - switched all image resizing methods to ImageIO - various renames * Fix blurhash formatting issues, `swift-format-ignore-file` doesn't work * Processing all media within unique folders to avoid conflicts * Fix various warnings * Rename `sizeForItemAt(_ url: URL)` to `sizeForItem(at url: URL)` * Remove unnecessary resizeImage(UIImage) method, start by copying not moving the file to the unique location * Add back warning for roomDetails.avatarURL
This commit is contained in:
@@ -576,23 +576,23 @@ class RoomProxyMock: RoomProxyProtocol {
|
||||
}
|
||||
//MARK: - sendImage
|
||||
|
||||
var sendImageUrlCallsCount = 0
|
||||
var sendImageUrlCalled: Bool {
|
||||
return sendImageUrlCallsCount > 0
|
||||
var sendImageUrlThumbnailURLImageInfoCallsCount = 0
|
||||
var sendImageUrlThumbnailURLImageInfoCalled: Bool {
|
||||
return sendImageUrlThumbnailURLImageInfoCallsCount > 0
|
||||
}
|
||||
var sendImageUrlReceivedUrl: URL?
|
||||
var sendImageUrlReceivedInvocations: [URL] = []
|
||||
var sendImageUrlReturnValue: Result<Void, RoomProxyError>!
|
||||
var sendImageUrlClosure: ((URL) async -> Result<Void, RoomProxyError>)?
|
||||
var sendImageUrlThumbnailURLImageInfoReceivedArguments: (url: URL, thumbnailURL: URL, imageInfo: ImageInfo)?
|
||||
var sendImageUrlThumbnailURLImageInfoReceivedInvocations: [(url: URL, thumbnailURL: URL, imageInfo: ImageInfo)] = []
|
||||
var sendImageUrlThumbnailURLImageInfoReturnValue: Result<Void, RoomProxyError>!
|
||||
var sendImageUrlThumbnailURLImageInfoClosure: ((URL, URL, ImageInfo) async -> Result<Void, RoomProxyError>)?
|
||||
|
||||
func sendImage(url: URL) async -> Result<Void, RoomProxyError> {
|
||||
sendImageUrlCallsCount += 1
|
||||
sendImageUrlReceivedUrl = url
|
||||
sendImageUrlReceivedInvocations.append(url)
|
||||
if let sendImageUrlClosure = sendImageUrlClosure {
|
||||
return await sendImageUrlClosure(url)
|
||||
func sendImage(url: URL, thumbnailURL: URL, imageInfo: ImageInfo) async -> Result<Void, RoomProxyError> {
|
||||
sendImageUrlThumbnailURLImageInfoCallsCount += 1
|
||||
sendImageUrlThumbnailURLImageInfoReceivedArguments = (url: url, thumbnailURL: thumbnailURL, imageInfo: imageInfo)
|
||||
sendImageUrlThumbnailURLImageInfoReceivedInvocations.append((url: url, thumbnailURL: thumbnailURL, imageInfo: imageInfo))
|
||||
if let sendImageUrlThumbnailURLImageInfoClosure = sendImageUrlThumbnailURLImageInfoClosure {
|
||||
return await sendImageUrlThumbnailURLImageInfoClosure(url, thumbnailURL, imageInfo)
|
||||
} else {
|
||||
return sendImageUrlReturnValue
|
||||
return sendImageUrlThumbnailURLImageInfoReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - editMessage
|
||||
|
||||
Reference in New Issue
Block a user