Update the SDK.

This commit is contained in:
Doug
2024-08-29 14:39:49 +01:00
committed by Stefan Ceriu
parent 4925884f6c
commit 342ad57ce7
8 changed files with 37 additions and 117 deletions
@@ -13854,8 +13854,8 @@ class TimelineProxyMock: TimelineProxyProtocol {
var toggleReactionToCalled: Bool {
return toggleReactionToCallsCount > 0
}
var toggleReactionToReceivedArguments: (reaction: String, eventID: String)?
var toggleReactionToReceivedInvocations: [(reaction: String, eventID: String)] = []
var toggleReactionToReceivedArguments: (reaction: String, itemID: TimelineItemIdentifier)?
var toggleReactionToReceivedInvocations: [(reaction: String, itemID: TimelineItemIdentifier)] = []
var toggleReactionToUnderlyingReturnValue: Result<Void, TimelineProxyError>!
var toggleReactionToReturnValue: Result<Void, TimelineProxyError>! {
@@ -13881,16 +13881,16 @@ class TimelineProxyMock: TimelineProxyProtocol {
}
}
}
var toggleReactionToClosure: ((String, String) async -> Result<Void, TimelineProxyError>)?
var toggleReactionToClosure: ((String, TimelineItemIdentifier) async -> Result<Void, TimelineProxyError>)?
func toggleReaction(_ reaction: String, to eventID: String) async -> Result<Void, TimelineProxyError> {
func toggleReaction(_ reaction: String, to itemID: TimelineItemIdentifier) async -> Result<Void, TimelineProxyError> {
toggleReactionToCallsCount += 1
toggleReactionToReceivedArguments = (reaction: reaction, eventID: eventID)
toggleReactionToReceivedArguments = (reaction: reaction, itemID: itemID)
DispatchQueue.main.async {
self.toggleReactionToReceivedInvocations.append((reaction: reaction, eventID: eventID))
self.toggleReactionToReceivedInvocations.append((reaction: reaction, itemID: itemID))
}
if let toggleReactionToClosure = toggleReactionToClosure {
return await toggleReactionToClosure(reaction, eventID)
return await toggleReactionToClosure(reaction, itemID)
} else {
return toggleReactionToReturnValue
}
@@ -9974,82 +9974,6 @@ open class NotificationSettingsSDKMock: MatrixRustSDK.NotificationSettings {
try await unmuteRoomRoomIdIsEncryptedIsOneToOneClosure?(roomId, isEncrypted, isOneToOne)
}
}
open class OidcAuthorizationDataSDKMock: MatrixRustSDK.OidcAuthorizationData {
init() {
super.init(noPointer: .init())
}
public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) {
fatalError("init(unsafeFromRawPointer:) has not been implemented")
}
fileprivate var pointer: UnsafeMutableRawPointer!
//MARK: - loginUrl
var loginUrlUnderlyingCallsCount = 0
open var loginUrlCallsCount: Int {
get {
if Thread.isMainThread {
return loginUrlUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = loginUrlUnderlyingCallsCount
}
return returnValue!
}
}
set {
if Thread.isMainThread {
loginUrlUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
loginUrlUnderlyingCallsCount = newValue
}
}
}
}
open var loginUrlCalled: Bool {
return loginUrlCallsCount > 0
}
var loginUrlUnderlyingReturnValue: String!
open var loginUrlReturnValue: String! {
get {
if Thread.isMainThread {
return loginUrlUnderlyingReturnValue
} else {
var returnValue: String? = nil
DispatchQueue.main.sync {
returnValue = loginUrlUnderlyingReturnValue
}
return returnValue!
}
}
set {
if Thread.isMainThread {
loginUrlUnderlyingReturnValue = newValue
} else {
DispatchQueue.main.sync {
loginUrlUnderlyingReturnValue = newValue
}
}
}
}
open var loginUrlClosure: (() -> String)?
open override func loginUrl() -> String {
loginUrlCallsCount += 1
if let loginUrlClosure = loginUrlClosure {
return loginUrlClosure()
} else {
return loginUrlReturnValue
}
}
}
open class QrCodeDataSDKMock: MatrixRustSDK.QrCodeData {
init() {
super.init(noPointer: .init())
@@ -20067,16 +19991,16 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline {
//MARK: - toggleReaction
open var toggleReactionEventIdKeyThrowableError: Error?
var toggleReactionEventIdKeyUnderlyingCallsCount = 0
open var toggleReactionEventIdKeyCallsCount: Int {
open var toggleReactionUniqueIdKeyThrowableError: Error?
var toggleReactionUniqueIdKeyUnderlyingCallsCount = 0
open var toggleReactionUniqueIdKeyCallsCount: Int {
get {
if Thread.isMainThread {
return toggleReactionEventIdKeyUnderlyingCallsCount
return toggleReactionUniqueIdKeyUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = toggleReactionEventIdKeyUnderlyingCallsCount
returnValue = toggleReactionUniqueIdKeyUnderlyingCallsCount
}
return returnValue!
@@ -20084,31 +20008,31 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline {
}
set {
if Thread.isMainThread {
toggleReactionEventIdKeyUnderlyingCallsCount = newValue
toggleReactionUniqueIdKeyUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
toggleReactionEventIdKeyUnderlyingCallsCount = newValue
toggleReactionUniqueIdKeyUnderlyingCallsCount = newValue
}
}
}
}
open var toggleReactionEventIdKeyCalled: Bool {
return toggleReactionEventIdKeyCallsCount > 0
open var toggleReactionUniqueIdKeyCalled: Bool {
return toggleReactionUniqueIdKeyCallsCount > 0
}
open var toggleReactionEventIdKeyReceivedArguments: (eventId: String, key: String)?
open var toggleReactionEventIdKeyReceivedInvocations: [(eventId: String, key: String)] = []
open var toggleReactionEventIdKeyClosure: ((String, String) async throws -> Void)?
open var toggleReactionUniqueIdKeyReceivedArguments: (uniqueId: String, key: String)?
open var toggleReactionUniqueIdKeyReceivedInvocations: [(uniqueId: String, key: String)] = []
open var toggleReactionUniqueIdKeyClosure: ((String, String) async throws -> Void)?
open override func toggleReaction(eventId: String, key: String) async throws {
if let error = toggleReactionEventIdKeyThrowableError {
open override func toggleReaction(uniqueId: String, key: String) async throws {
if let error = toggleReactionUniqueIdKeyThrowableError {
throw error
}
toggleReactionEventIdKeyCallsCount += 1
toggleReactionEventIdKeyReceivedArguments = (eventId: eventId, key: key)
toggleReactionUniqueIdKeyCallsCount += 1
toggleReactionUniqueIdKeyReceivedArguments = (uniqueId: uniqueId, key: key)
DispatchQueue.main.async {
self.toggleReactionEventIdKeyReceivedInvocations.append((eventId: eventId, key: key))
self.toggleReactionUniqueIdKeyReceivedInvocations.append((uniqueId: uniqueId, key: key))
}
try await toggleReactionEventIdKeyClosure?(eventId, key)
try await toggleReactionUniqueIdKeyClosure?(uniqueId, key)
}
//MARK: - unpinEvent