Bump the RustSDK to v1.1.22

This commit is contained in:
Stefan Ceriu
2023-10-12 11:15:56 +03:00
parent 7842ca831a
commit b5e334f4a9
7 changed files with 32 additions and 33 deletions
@@ -1,4 +1,4 @@
// Generated using Sourcery 2.0.3 — https://github.com/krzysztofzablocki/Sourcery
// Generated using Sourcery 2.1.1 — https://github.com/krzysztofzablocki/Sourcery
// DO NOT EDIT
// swiftlint:disable all
@@ -199,10 +199,10 @@ class SDKClientMock: SDKClientProtocol {
}
public var getMediaContentMediaSourceReceivedMediaSource: MediaSource?
public var getMediaContentMediaSourceReceivedInvocations: [MediaSource] = []
public var getMediaContentMediaSourceReturnValue: [UInt8]!
public var getMediaContentMediaSourceClosure: ((MediaSource) throws -> [UInt8])?
public var getMediaContentMediaSourceReturnValue: Data!
public var getMediaContentMediaSourceClosure: ((MediaSource) throws -> Data)?
public func getMediaContent(mediaSource: MediaSource) throws -> [UInt8] {
public func getMediaContent(mediaSource: MediaSource) throws -> Data {
if let error = getMediaContentMediaSourceThrowableError {
throw error
}
@@ -249,10 +249,10 @@ class SDKClientMock: SDKClientProtocol {
}
public var getMediaThumbnailMediaSourceWidthHeightReceivedArguments: (mediaSource: MediaSource, width: UInt64, height: UInt64)?
public var getMediaThumbnailMediaSourceWidthHeightReceivedInvocations: [(mediaSource: MediaSource, width: UInt64, height: UInt64)] = []
public var getMediaThumbnailMediaSourceWidthHeightReturnValue: [UInt8]!
public var getMediaThumbnailMediaSourceWidthHeightClosure: ((MediaSource, UInt64, UInt64) throws -> [UInt8])?
public var getMediaThumbnailMediaSourceWidthHeightReturnValue: Data!
public var getMediaThumbnailMediaSourceWidthHeightClosure: ((MediaSource, UInt64, UInt64) throws -> Data)?
public func getMediaThumbnail(mediaSource: MediaSource, width: UInt64, height: UInt64) throws -> [UInt8] {
public func getMediaThumbnail(mediaSource: MediaSource, width: UInt64, height: UInt64) throws -> Data {
if let error = getMediaThumbnailMediaSourceWidthHeightThrowableError {
throw error
}
@@ -650,11 +650,11 @@ class SDKClientMock: SDKClientProtocol {
public var uploadAvatarMimeTypeDataCalled: Bool {
return uploadAvatarMimeTypeDataCallsCount > 0
}
public var uploadAvatarMimeTypeDataReceivedArguments: (mimeType: String, data: [UInt8])?
public var uploadAvatarMimeTypeDataReceivedInvocations: [(mimeType: String, data: [UInt8])] = []
public var uploadAvatarMimeTypeDataClosure: ((String, [UInt8]) throws -> Void)?
public var uploadAvatarMimeTypeDataReceivedArguments: (mimeType: String, data: Data)?
public var uploadAvatarMimeTypeDataReceivedInvocations: [(mimeType: String, data: Data)] = []
public var uploadAvatarMimeTypeDataClosure: ((String, Data) throws -> Void)?
public func uploadAvatar(mimeType: String, data: [UInt8]) throws {
public func uploadAvatar(mimeType: String, data: Data) throws {
if let error = uploadAvatarMimeTypeDataThrowableError {
throw error
}
@@ -670,12 +670,12 @@ class SDKClientMock: SDKClientProtocol {
public var uploadMediaMimeTypeDataProgressWatcherCalled: Bool {
return uploadMediaMimeTypeDataProgressWatcherCallsCount > 0
}
public var uploadMediaMimeTypeDataProgressWatcherReceivedArguments: (mimeType: String, data: [UInt8], progressWatcher: ProgressWatcher?)?
public var uploadMediaMimeTypeDataProgressWatcherReceivedInvocations: [(mimeType: String, data: [UInt8], progressWatcher: ProgressWatcher?)] = []
public var uploadMediaMimeTypeDataProgressWatcherReceivedArguments: (mimeType: String, data: Data, progressWatcher: ProgressWatcher?)?
public var uploadMediaMimeTypeDataProgressWatcherReceivedInvocations: [(mimeType: String, data: Data, progressWatcher: ProgressWatcher?)] = []
public var uploadMediaMimeTypeDataProgressWatcherReturnValue: String!
public var uploadMediaMimeTypeDataProgressWatcherClosure: ((String, [UInt8], ProgressWatcher?) throws -> String)?
public var uploadMediaMimeTypeDataProgressWatcherClosure: ((String, Data, ProgressWatcher?) throws -> String)?
public func uploadMedia(mimeType: String, data: [UInt8], progressWatcher: ProgressWatcher?) throws -> String {
public func uploadMedia(mimeType: String, data: Data, progressWatcher: ProgressWatcher?) throws -> String {
if let error = uploadMediaMimeTypeDataProgressWatcherThrowableError {
throw error
}
@@ -210,7 +210,7 @@ class ClientProxy: ClientProxyProtocol {
return await Task.dispatch(on: clientQueue) {
do {
let data = try Data(contentsOf: media.url)
let matrixUrl = try self.client.uploadMedia(mimeType: mimeType, data: [UInt8](data), progressWatcher: nil)
let matrixUrl = try self.client.uploadMedia(mimeType: mimeType, data: data, progressWatcher: nil)
return .success(matrixUrl)
} catch let error as ClientError {
return .failure(ClientProxyError.failedUploadingMedia(error.code))
@@ -328,7 +328,7 @@ class ClientProxy: ClientProxyProtocol {
do {
let data = try Data(contentsOf: imageURL)
try self.client.uploadAvatar(mimeType: mimeType, data: [UInt8](data))
try self.client.uploadAvatar(mimeType: mimeType, data: data)
Task {
await self.loadUserAvatarURL()
}
@@ -56,7 +56,7 @@ actor MediaLoader: MediaLoaderProtocol {
// MARK: - Private
private func enqueueLoadMediaRequest(forSource source: MediaSourceProxy, operation: @escaping () throws -> [UInt8]) async throws -> Data {
private func enqueueLoadMediaRequest(forSource source: MediaSourceProxy, operation: @escaping () throws -> Data) async throws -> Data {
if let ongoingRequest = ongoingRequests[source] {
return try await withCheckedThrowingContinuation { continuation in
ongoingRequest.continuations.append(continuation)
@@ -72,8 +72,7 @@ actor MediaLoader: MediaLoaderProtocol {
do {
let result = try await Task.dispatch(on: clientQueue) {
let bytes = try operation()
return Data(bytes: bytes, count: bytes.count)
try operation()
}
ongoingRequest.continuations.forEach { $0.resume(returning: result) }
@@ -646,7 +646,7 @@ class RoomProxy: RoomProxyProtocol {
do {
let data = try Data(contentsOf: imageURL)
return try .success(self.room.uploadAvatar(mimeType: mimeType, data: [UInt8](data), mediaInfo: nil))
return try .success(self.room.uploadAvatar(mimeType: mimeType, data: data, mediaInfo: nil))
} catch {
return .failure(.failedUploadingAvatar)
}