mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 19:44:05 +00:00
Update the SDK. (#3407)
Fixes a bug where we couldn't open images sent by EXA with a mimetype of image/*
This commit is contained in:
@@ -7794,7 +7794,7 @@
|
|||||||
repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift";
|
repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift";
|
||||||
requirement = {
|
requirement = {
|
||||||
kind = exactVersion;
|
kind = exactVersion;
|
||||||
version = 1.0.56;
|
version = 1.0.57;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = {
|
701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = {
|
||||||
|
|||||||
@@ -149,8 +149,8 @@
|
|||||||
"kind" : "remoteSourceControl",
|
"kind" : "remoteSourceControl",
|
||||||
"location" : "https://github.com/element-hq/matrix-rust-components-swift",
|
"location" : "https://github.com/element-hq/matrix-rust-components-swift",
|
||||||
"state" : {
|
"state" : {
|
||||||
"revision" : "1366154c2e601179514be93e2fca48969c4f2ed8",
|
"revision" : "5f01589d44aa7045dc1ad87f2583f6083295d3eb",
|
||||||
"version" : "1.0.56"
|
"version" : "1.0.57"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,8 +18,7 @@ struct EventTimelineItemSDKMockConfiguration {
|
|||||||
|
|
||||||
extension EventTimelineItem {
|
extension EventTimelineItem {
|
||||||
init(configuration: EventTimelineItemSDKMockConfiguration) {
|
init(configuration: EventTimelineItemSDKMockConfiguration) {
|
||||||
self.init(isLocal: false,
|
self.init(isRemote: true,
|
||||||
isRemote: true,
|
|
||||||
eventOrTransactionId: .eventId(eventId: configuration.eventID),
|
eventOrTransactionId: .eventId(eventId: configuration.eventID),
|
||||||
sender: configuration.sender,
|
sender: configuration.sender,
|
||||||
senderProfile: .pending,
|
senderProfile: .pending,
|
||||||
@@ -28,12 +27,11 @@ extension EventTimelineItem {
|
|||||||
content: configuration.content,
|
content: configuration.content,
|
||||||
timestamp: 0,
|
timestamp: 0,
|
||||||
reactions: [],
|
reactions: [],
|
||||||
debugInfoProvider: EventTimelineItemDebugInfoProviderSDKMock(),
|
|
||||||
localSendState: nil,
|
localSendState: nil,
|
||||||
readReceipts: [:],
|
readReceipts: [:],
|
||||||
origin: nil,
|
origin: nil,
|
||||||
canBeRepliedTo: false,
|
canBeRepliedTo: false,
|
||||||
shieldsProvider: EventShieldsProviderSDKMock())
|
lazyProvider: LazyTimelineItemProviderSDKMock())
|
||||||
}
|
}
|
||||||
|
|
||||||
static var mockMessage: EventTimelineItem {
|
static var mockMessage: EventTimelineItem {
|
||||||
|
|||||||
@@ -1160,16 +1160,16 @@ open class ClientSDKMock: MatrixRustSDK.Client {
|
|||||||
|
|
||||||
//MARK: - getMediaFile
|
//MARK: - getMediaFile
|
||||||
|
|
||||||
open var getMediaFileMediaSourceBodyMimeTypeUseCacheTempDirThrowableError: Error?
|
open var getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirThrowableError: Error?
|
||||||
var getMediaFileMediaSourceBodyMimeTypeUseCacheTempDirUnderlyingCallsCount = 0
|
var getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirUnderlyingCallsCount = 0
|
||||||
open var getMediaFileMediaSourceBodyMimeTypeUseCacheTempDirCallsCount: Int {
|
open var getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirCallsCount: Int {
|
||||||
get {
|
get {
|
||||||
if Thread.isMainThread {
|
if Thread.isMainThread {
|
||||||
return getMediaFileMediaSourceBodyMimeTypeUseCacheTempDirUnderlyingCallsCount
|
return getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirUnderlyingCallsCount
|
||||||
} else {
|
} else {
|
||||||
var returnValue: Int? = nil
|
var returnValue: Int? = nil
|
||||||
DispatchQueue.main.sync {
|
DispatchQueue.main.sync {
|
||||||
returnValue = getMediaFileMediaSourceBodyMimeTypeUseCacheTempDirUnderlyingCallsCount
|
returnValue = getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirUnderlyingCallsCount
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnValue!
|
return returnValue!
|
||||||
@@ -1177,29 +1177,29 @@ open class ClientSDKMock: MatrixRustSDK.Client {
|
|||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
if Thread.isMainThread {
|
if Thread.isMainThread {
|
||||||
getMediaFileMediaSourceBodyMimeTypeUseCacheTempDirUnderlyingCallsCount = newValue
|
getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirUnderlyingCallsCount = newValue
|
||||||
} else {
|
} else {
|
||||||
DispatchQueue.main.sync {
|
DispatchQueue.main.sync {
|
||||||
getMediaFileMediaSourceBodyMimeTypeUseCacheTempDirUnderlyingCallsCount = newValue
|
getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirUnderlyingCallsCount = newValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
open var getMediaFileMediaSourceBodyMimeTypeUseCacheTempDirCalled: Bool {
|
open var getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirCalled: Bool {
|
||||||
return getMediaFileMediaSourceBodyMimeTypeUseCacheTempDirCallsCount > 0
|
return getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirCallsCount > 0
|
||||||
}
|
}
|
||||||
open var getMediaFileMediaSourceBodyMimeTypeUseCacheTempDirReceivedArguments: (mediaSource: MediaSource, body: String?, mimeType: String, useCache: Bool, tempDir: String?)?
|
open var getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirReceivedArguments: (mediaSource: MediaSource, filename: String?, mimeType: String, useCache: Bool, tempDir: String?)?
|
||||||
open var getMediaFileMediaSourceBodyMimeTypeUseCacheTempDirReceivedInvocations: [(mediaSource: MediaSource, body: String?, mimeType: String, useCache: Bool, tempDir: String?)] = []
|
open var getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirReceivedInvocations: [(mediaSource: MediaSource, filename: String?, mimeType: String, useCache: Bool, tempDir: String?)] = []
|
||||||
|
|
||||||
var getMediaFileMediaSourceBodyMimeTypeUseCacheTempDirUnderlyingReturnValue: MediaFileHandle!
|
var getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirUnderlyingReturnValue: MediaFileHandle!
|
||||||
open var getMediaFileMediaSourceBodyMimeTypeUseCacheTempDirReturnValue: MediaFileHandle! {
|
open var getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirReturnValue: MediaFileHandle! {
|
||||||
get {
|
get {
|
||||||
if Thread.isMainThread {
|
if Thread.isMainThread {
|
||||||
return getMediaFileMediaSourceBodyMimeTypeUseCacheTempDirUnderlyingReturnValue
|
return getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirUnderlyingReturnValue
|
||||||
} else {
|
} else {
|
||||||
var returnValue: MediaFileHandle? = nil
|
var returnValue: MediaFileHandle? = nil
|
||||||
DispatchQueue.main.sync {
|
DispatchQueue.main.sync {
|
||||||
returnValue = getMediaFileMediaSourceBodyMimeTypeUseCacheTempDirUnderlyingReturnValue
|
returnValue = getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirUnderlyingReturnValue
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnValue!
|
return returnValue!
|
||||||
@@ -1207,29 +1207,29 @@ open class ClientSDKMock: MatrixRustSDK.Client {
|
|||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
if Thread.isMainThread {
|
if Thread.isMainThread {
|
||||||
getMediaFileMediaSourceBodyMimeTypeUseCacheTempDirUnderlyingReturnValue = newValue
|
getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirUnderlyingReturnValue = newValue
|
||||||
} else {
|
} else {
|
||||||
DispatchQueue.main.sync {
|
DispatchQueue.main.sync {
|
||||||
getMediaFileMediaSourceBodyMimeTypeUseCacheTempDirUnderlyingReturnValue = newValue
|
getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirUnderlyingReturnValue = newValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
open var getMediaFileMediaSourceBodyMimeTypeUseCacheTempDirClosure: ((MediaSource, String?, String, Bool, String?) async throws -> MediaFileHandle)?
|
open var getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirClosure: ((MediaSource, String?, String, Bool, String?) async throws -> MediaFileHandle)?
|
||||||
|
|
||||||
open override func getMediaFile(mediaSource: MediaSource, body: String?, mimeType: String, useCache: Bool, tempDir: String?) async throws -> MediaFileHandle {
|
open override func getMediaFile(mediaSource: MediaSource, filename: String?, mimeType: String, useCache: Bool, tempDir: String?) async throws -> MediaFileHandle {
|
||||||
if let error = getMediaFileMediaSourceBodyMimeTypeUseCacheTempDirThrowableError {
|
if let error = getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirThrowableError {
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
getMediaFileMediaSourceBodyMimeTypeUseCacheTempDirCallsCount += 1
|
getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirCallsCount += 1
|
||||||
getMediaFileMediaSourceBodyMimeTypeUseCacheTempDirReceivedArguments = (mediaSource: mediaSource, body: body, mimeType: mimeType, useCache: useCache, tempDir: tempDir)
|
getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirReceivedArguments = (mediaSource: mediaSource, filename: filename, mimeType: mimeType, useCache: useCache, tempDir: tempDir)
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
self.getMediaFileMediaSourceBodyMimeTypeUseCacheTempDirReceivedInvocations.append((mediaSource: mediaSource, body: body, mimeType: mimeType, useCache: useCache, tempDir: tempDir))
|
self.getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirReceivedInvocations.append((mediaSource: mediaSource, filename: filename, mimeType: mimeType, useCache: useCache, tempDir: tempDir))
|
||||||
}
|
}
|
||||||
if let getMediaFileMediaSourceBodyMimeTypeUseCacheTempDirClosure = getMediaFileMediaSourceBodyMimeTypeUseCacheTempDirClosure {
|
if let getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirClosure = getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirClosure {
|
||||||
return try await getMediaFileMediaSourceBodyMimeTypeUseCacheTempDirClosure(mediaSource, body, mimeType, useCache, tempDir)
|
return try await getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirClosure(mediaSource, filename, mimeType, useCache, tempDir)
|
||||||
} else {
|
} else {
|
||||||
return getMediaFileMediaSourceBodyMimeTypeUseCacheTempDirReturnValue
|
return getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirReturnValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2206,6 +2206,81 @@ open class ClientSDKMock: MatrixRustSDK.Client {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//MARK: - knock
|
||||||
|
|
||||||
|
open var knockRoomIdOrAliasThrowableError: Error?
|
||||||
|
var knockRoomIdOrAliasUnderlyingCallsCount = 0
|
||||||
|
open var knockRoomIdOrAliasCallsCount: Int {
|
||||||
|
get {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
return knockRoomIdOrAliasUnderlyingCallsCount
|
||||||
|
} else {
|
||||||
|
var returnValue: Int? = nil
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
returnValue = knockRoomIdOrAliasUnderlyingCallsCount
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnValue!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
knockRoomIdOrAliasUnderlyingCallsCount = newValue
|
||||||
|
} else {
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
knockRoomIdOrAliasUnderlyingCallsCount = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
open var knockRoomIdOrAliasCalled: Bool {
|
||||||
|
return knockRoomIdOrAliasCallsCount > 0
|
||||||
|
}
|
||||||
|
open var knockRoomIdOrAliasReceivedRoomIdOrAlias: String?
|
||||||
|
open var knockRoomIdOrAliasReceivedInvocations: [String] = []
|
||||||
|
|
||||||
|
var knockRoomIdOrAliasUnderlyingReturnValue: Room!
|
||||||
|
open var knockRoomIdOrAliasReturnValue: Room! {
|
||||||
|
get {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
return knockRoomIdOrAliasUnderlyingReturnValue
|
||||||
|
} else {
|
||||||
|
var returnValue: Room? = nil
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
returnValue = knockRoomIdOrAliasUnderlyingReturnValue
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnValue!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
knockRoomIdOrAliasUnderlyingReturnValue = newValue
|
||||||
|
} else {
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
knockRoomIdOrAliasUnderlyingReturnValue = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
open var knockRoomIdOrAliasClosure: ((String) async throws -> Room)?
|
||||||
|
|
||||||
|
open override func knock(roomIdOrAlias: String) async throws -> Room {
|
||||||
|
if let error = knockRoomIdOrAliasThrowableError {
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
knockRoomIdOrAliasCallsCount += 1
|
||||||
|
knockRoomIdOrAliasReceivedRoomIdOrAlias = roomIdOrAlias
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
self.knockRoomIdOrAliasReceivedInvocations.append(roomIdOrAlias)
|
||||||
|
}
|
||||||
|
if let knockRoomIdOrAliasClosure = knockRoomIdOrAliasClosure {
|
||||||
|
return try await knockRoomIdOrAliasClosure(roomIdOrAlias)
|
||||||
|
} else {
|
||||||
|
return knockRoomIdOrAliasReturnValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//MARK: - login
|
//MARK: - login
|
||||||
|
|
||||||
open var loginUsernamePasswordInitialDeviceNameDeviceIdThrowableError: Error?
|
open var loginUsernamePasswordInitialDeviceNameDeviceIdThrowableError: Error?
|
||||||
@@ -6896,164 +6971,6 @@ open class EncryptionSDKMock: MatrixRustSDK.Encryption {
|
|||||||
await waitForE2eeInitializationTasksClosure?()
|
await waitForE2eeInitializationTasksClosure?()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
open class EventShieldsProviderSDKMock: MatrixRustSDK.EventShieldsProvider {
|
|
||||||
init() {
|
|
||||||
super.init(noPointer: .init())
|
|
||||||
}
|
|
||||||
|
|
||||||
public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) {
|
|
||||||
fatalError("init(unsafeFromRawPointer:) has not been implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
fileprivate var pointer: UnsafeMutableRawPointer!
|
|
||||||
|
|
||||||
//MARK: - getShields
|
|
||||||
|
|
||||||
var getShieldsStrictUnderlyingCallsCount = 0
|
|
||||||
open var getShieldsStrictCallsCount: Int {
|
|
||||||
get {
|
|
||||||
if Thread.isMainThread {
|
|
||||||
return getShieldsStrictUnderlyingCallsCount
|
|
||||||
} else {
|
|
||||||
var returnValue: Int? = nil
|
|
||||||
DispatchQueue.main.sync {
|
|
||||||
returnValue = getShieldsStrictUnderlyingCallsCount
|
|
||||||
}
|
|
||||||
|
|
||||||
return returnValue!
|
|
||||||
}
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
if Thread.isMainThread {
|
|
||||||
getShieldsStrictUnderlyingCallsCount = newValue
|
|
||||||
} else {
|
|
||||||
DispatchQueue.main.sync {
|
|
||||||
getShieldsStrictUnderlyingCallsCount = newValue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
open var getShieldsStrictCalled: Bool {
|
|
||||||
return getShieldsStrictCallsCount > 0
|
|
||||||
}
|
|
||||||
open var getShieldsStrictReceivedStrict: Bool?
|
|
||||||
open var getShieldsStrictReceivedInvocations: [Bool] = []
|
|
||||||
|
|
||||||
var getShieldsStrictUnderlyingReturnValue: ShieldState?
|
|
||||||
open var getShieldsStrictReturnValue: ShieldState? {
|
|
||||||
get {
|
|
||||||
if Thread.isMainThread {
|
|
||||||
return getShieldsStrictUnderlyingReturnValue
|
|
||||||
} else {
|
|
||||||
var returnValue: ShieldState?? = nil
|
|
||||||
DispatchQueue.main.sync {
|
|
||||||
returnValue = getShieldsStrictUnderlyingReturnValue
|
|
||||||
}
|
|
||||||
|
|
||||||
return returnValue!
|
|
||||||
}
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
if Thread.isMainThread {
|
|
||||||
getShieldsStrictUnderlyingReturnValue = newValue
|
|
||||||
} else {
|
|
||||||
DispatchQueue.main.sync {
|
|
||||||
getShieldsStrictUnderlyingReturnValue = newValue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
open var getShieldsStrictClosure: ((Bool) -> ShieldState?)?
|
|
||||||
|
|
||||||
open override func getShields(strict: Bool) -> ShieldState? {
|
|
||||||
getShieldsStrictCallsCount += 1
|
|
||||||
getShieldsStrictReceivedStrict = strict
|
|
||||||
DispatchQueue.main.async {
|
|
||||||
self.getShieldsStrictReceivedInvocations.append(strict)
|
|
||||||
}
|
|
||||||
if let getShieldsStrictClosure = getShieldsStrictClosure {
|
|
||||||
return getShieldsStrictClosure(strict)
|
|
||||||
} else {
|
|
||||||
return getShieldsStrictReturnValue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
open class EventTimelineItemDebugInfoProviderSDKMock: MatrixRustSDK.EventTimelineItemDebugInfoProvider {
|
|
||||||
init() {
|
|
||||||
super.init(noPointer: .init())
|
|
||||||
}
|
|
||||||
|
|
||||||
public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) {
|
|
||||||
fatalError("init(unsafeFromRawPointer:) has not been implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
fileprivate var pointer: UnsafeMutableRawPointer!
|
|
||||||
|
|
||||||
//MARK: - get
|
|
||||||
|
|
||||||
var getUnderlyingCallsCount = 0
|
|
||||||
open var getCallsCount: Int {
|
|
||||||
get {
|
|
||||||
if Thread.isMainThread {
|
|
||||||
return getUnderlyingCallsCount
|
|
||||||
} else {
|
|
||||||
var returnValue: Int? = nil
|
|
||||||
DispatchQueue.main.sync {
|
|
||||||
returnValue = getUnderlyingCallsCount
|
|
||||||
}
|
|
||||||
|
|
||||||
return returnValue!
|
|
||||||
}
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
if Thread.isMainThread {
|
|
||||||
getUnderlyingCallsCount = newValue
|
|
||||||
} else {
|
|
||||||
DispatchQueue.main.sync {
|
|
||||||
getUnderlyingCallsCount = newValue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
open var getCalled: Bool {
|
|
||||||
return getCallsCount > 0
|
|
||||||
}
|
|
||||||
|
|
||||||
var getUnderlyingReturnValue: EventTimelineItemDebugInfo!
|
|
||||||
open var getReturnValue: EventTimelineItemDebugInfo! {
|
|
||||||
get {
|
|
||||||
if Thread.isMainThread {
|
|
||||||
return getUnderlyingReturnValue
|
|
||||||
} else {
|
|
||||||
var returnValue: EventTimelineItemDebugInfo? = nil
|
|
||||||
DispatchQueue.main.sync {
|
|
||||||
returnValue = getUnderlyingReturnValue
|
|
||||||
}
|
|
||||||
|
|
||||||
return returnValue!
|
|
||||||
}
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
if Thread.isMainThread {
|
|
||||||
getUnderlyingReturnValue = newValue
|
|
||||||
} else {
|
|
||||||
DispatchQueue.main.sync {
|
|
||||||
getUnderlyingReturnValue = newValue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
open var getClosure: (() -> EventTimelineItemDebugInfo)?
|
|
||||||
|
|
||||||
open override func get() -> EventTimelineItemDebugInfo {
|
|
||||||
getCallsCount += 1
|
|
||||||
if let getClosure = getClosure {
|
|
||||||
return getClosure()
|
|
||||||
} else {
|
|
||||||
return getReturnValue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
open class HomeserverLoginDetailsSDKMock: MatrixRustSDK.HomeserverLoginDetails {
|
open class HomeserverLoginDetailsSDKMock: MatrixRustSDK.HomeserverLoginDetails {
|
||||||
init() {
|
init() {
|
||||||
super.init(noPointer: .init())
|
super.init(noPointer: .init())
|
||||||
@@ -7624,6 +7541,153 @@ open class InReplyToDetailsSDKMock: MatrixRustSDK.InReplyToDetails {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
open class LazyTimelineItemProviderSDKMock: MatrixRustSDK.LazyTimelineItemProvider {
|
||||||
|
init() {
|
||||||
|
super.init(noPointer: .init())
|
||||||
|
}
|
||||||
|
|
||||||
|
public required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) {
|
||||||
|
fatalError("init(unsafeFromRawPointer:) has not been implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
fileprivate var pointer: UnsafeMutableRawPointer!
|
||||||
|
|
||||||
|
//MARK: - debugInfo
|
||||||
|
|
||||||
|
var debugInfoUnderlyingCallsCount = 0
|
||||||
|
open var debugInfoCallsCount: Int {
|
||||||
|
get {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
return debugInfoUnderlyingCallsCount
|
||||||
|
} else {
|
||||||
|
var returnValue: Int? = nil
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
returnValue = debugInfoUnderlyingCallsCount
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnValue!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
debugInfoUnderlyingCallsCount = newValue
|
||||||
|
} else {
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
debugInfoUnderlyingCallsCount = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
open var debugInfoCalled: Bool {
|
||||||
|
return debugInfoCallsCount > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
var debugInfoUnderlyingReturnValue: EventTimelineItemDebugInfo!
|
||||||
|
open var debugInfoReturnValue: EventTimelineItemDebugInfo! {
|
||||||
|
get {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
return debugInfoUnderlyingReturnValue
|
||||||
|
} else {
|
||||||
|
var returnValue: EventTimelineItemDebugInfo? = nil
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
returnValue = debugInfoUnderlyingReturnValue
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnValue!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
debugInfoUnderlyingReturnValue = newValue
|
||||||
|
} else {
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
debugInfoUnderlyingReturnValue = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
open var debugInfoClosure: (() -> EventTimelineItemDebugInfo)?
|
||||||
|
|
||||||
|
open override func debugInfo() -> EventTimelineItemDebugInfo {
|
||||||
|
debugInfoCallsCount += 1
|
||||||
|
if let debugInfoClosure = debugInfoClosure {
|
||||||
|
return debugInfoClosure()
|
||||||
|
} else {
|
||||||
|
return debugInfoReturnValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//MARK: - getShields
|
||||||
|
|
||||||
|
var getShieldsStrictUnderlyingCallsCount = 0
|
||||||
|
open var getShieldsStrictCallsCount: Int {
|
||||||
|
get {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
return getShieldsStrictUnderlyingCallsCount
|
||||||
|
} else {
|
||||||
|
var returnValue: Int? = nil
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
returnValue = getShieldsStrictUnderlyingCallsCount
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnValue!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
getShieldsStrictUnderlyingCallsCount = newValue
|
||||||
|
} else {
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
getShieldsStrictUnderlyingCallsCount = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
open var getShieldsStrictCalled: Bool {
|
||||||
|
return getShieldsStrictCallsCount > 0
|
||||||
|
}
|
||||||
|
open var getShieldsStrictReceivedStrict: Bool?
|
||||||
|
open var getShieldsStrictReceivedInvocations: [Bool] = []
|
||||||
|
|
||||||
|
var getShieldsStrictUnderlyingReturnValue: ShieldState?
|
||||||
|
open var getShieldsStrictReturnValue: ShieldState? {
|
||||||
|
get {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
return getShieldsStrictUnderlyingReturnValue
|
||||||
|
} else {
|
||||||
|
var returnValue: ShieldState?? = nil
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
returnValue = getShieldsStrictUnderlyingReturnValue
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnValue!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
getShieldsStrictUnderlyingReturnValue = newValue
|
||||||
|
} else {
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
getShieldsStrictUnderlyingReturnValue = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
open var getShieldsStrictClosure: ((Bool) -> ShieldState?)?
|
||||||
|
|
||||||
|
open override func getShields(strict: Bool) -> ShieldState? {
|
||||||
|
getShieldsStrictCallsCount += 1
|
||||||
|
getShieldsStrictReceivedStrict = strict
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
self.getShieldsStrictReceivedInvocations.append(strict)
|
||||||
|
}
|
||||||
|
if let getShieldsStrictClosure = getShieldsStrictClosure {
|
||||||
|
return getShieldsStrictClosure(strict)
|
||||||
|
} else {
|
||||||
|
return getShieldsStrictReturnValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
open class MediaFileHandleSDKMock: MatrixRustSDK.MediaFileHandle {
|
open class MediaFileHandleSDKMock: MatrixRustSDK.MediaFileHandle {
|
||||||
init() {
|
init() {
|
||||||
super.init(noPointer: .init())
|
super.init(noPointer: .init())
|
||||||
@@ -12488,34 +12552,6 @@ open class RoomSDKMock: MatrixRustSDK.Room {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//MARK: - pinUserIdentity
|
|
||||||
|
|
||||||
open var pinUserIdentityUserIdThrowableError: Error?
|
|
||||||
var pinUserIdentityUserIdUnderlyingCallsCount = 0
|
|
||||||
open var pinUserIdentityUserIdCallsCount: Int {
|
|
||||||
get {
|
|
||||||
if Thread.isMainThread {
|
|
||||||
return pinUserIdentityUserIdUnderlyingCallsCount
|
|
||||||
} else {
|
|
||||||
var returnValue: Int? = nil
|
|
||||||
DispatchQueue.main.sync {
|
|
||||||
returnValue = pinUserIdentityUserIdUnderlyingCallsCount
|
|
||||||
}
|
|
||||||
|
|
||||||
return returnValue!
|
|
||||||
}
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
if Thread.isMainThread {
|
|
||||||
pinUserIdentityUserIdUnderlyingCallsCount = newValue
|
|
||||||
} else {
|
|
||||||
DispatchQueue.main.sync {
|
|
||||||
pinUserIdentityUserIdUnderlyingCallsCount = newValue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//MARK: - pinnedEventsTimeline
|
//MARK: - pinnedEventsTimeline
|
||||||
|
|
||||||
open var pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadMaxConcurrentRequestsThrowableError: Error?
|
open var pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadMaxConcurrentRequestsThrowableError: Error?
|
||||||
|
|||||||
@@ -845,7 +845,7 @@ class ClientProxy: ClientProxyProtocol {
|
|||||||
let roomListItem = try roomListService.room(roomId: roomID)
|
let roomListItem = try roomListService.room(roomId: roomID)
|
||||||
|
|
||||||
switch roomListItem.membership() {
|
switch roomListItem.membership() {
|
||||||
case .invited:
|
case .invited, .knocked:
|
||||||
return try .invited(InvitedRoomProxy(roomListItem: roomListItem,
|
return try .invited(InvitedRoomProxy(roomListItem: roomListItem,
|
||||||
room: roomListItem.invitedRoom()))
|
room: roomListItem.invitedRoom()))
|
||||||
case .joined:
|
case .joined:
|
||||||
|
|||||||
@@ -35,7 +35,11 @@ actor MediaLoader: MediaLoaderProtocol {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func loadMediaFileForSource(_ source: MediaSourceProxy, filename: String?) async throws -> MediaFileHandleProxy {
|
func loadMediaFileForSource(_ source: MediaSourceProxy, filename: String?) async throws -> MediaFileHandleProxy {
|
||||||
let result = try await client.getMediaFile(mediaSource: source.underlyingSource, body: filename, mimeType: source.mimeType ?? "application/octet-stream", useCache: true, tempDir: nil)
|
let result = try await client.getMediaFile(mediaSource: source.underlyingSource,
|
||||||
|
filename: filename,
|
||||||
|
mimeType: source.mimeType ?? "application/octet-stream",
|
||||||
|
useCache: true,
|
||||||
|
tempDir: nil)
|
||||||
|
|
||||||
return MediaFileHandleProxy(handle: result)
|
return MediaFileHandleProxy(handle: result)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -162,11 +162,11 @@ class EventTimelineItemProxy {
|
|||||||
lazy var timestamp = Date(timeIntervalSince1970: TimeInterval(item.timestamp / 1000))
|
lazy var timestamp = Date(timeIntervalSince1970: TimeInterval(item.timestamp / 1000))
|
||||||
|
|
||||||
lazy var debugInfo: TimelineItemDebugInfo = {
|
lazy var debugInfo: TimelineItemDebugInfo = {
|
||||||
let debugInfo = item.debugInfoProvider.get()
|
let debugInfo = item.lazyProvider.debugInfo()
|
||||||
return TimelineItemDebugInfo(model: debugInfo.model, originalJSON: debugInfo.originalJson, latestEditJSON: debugInfo.latestEditJson)
|
return TimelineItemDebugInfo(model: debugInfo.model, originalJSON: debugInfo.originalJson, latestEditJSON: debugInfo.latestEditJson)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
lazy var shieldState = item.shieldsProvider.getShields(strict: false)
|
lazy var shieldState = item.lazyProvider.getShields(strict: false)
|
||||||
|
|
||||||
lazy var readReceipts = item.readReceipts
|
lazy var readReceipts = item.readReceipts
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -60,7 +60,7 @@ packages:
|
|||||||
# Element/Matrix dependencies
|
# Element/Matrix dependencies
|
||||||
MatrixRustSDK:
|
MatrixRustSDK:
|
||||||
url: https://github.com/element-hq/matrix-rust-components-swift
|
url: https://github.com/element-hq/matrix-rust-components-swift
|
||||||
exactVersion: 1.0.56
|
exactVersion: 1.0.57
|
||||||
# path: ../matrix-rust-sdk
|
# path: ../matrix-rust-sdk
|
||||||
Compound:
|
Compound:
|
||||||
url: https://github.com/element-hq/compound-ios
|
url: https://github.com/element-hq/compound-ios
|
||||||
|
|||||||
Reference in New Issue
Block a user