Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ElementX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9364,7 +9364,7 @@
repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift";
requirement = {
kind = exactVersion;
version = "25.09.19-2";
version = 25.09.26;
};
};
701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

211 changes: 210 additions & 1 deletion ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated using Sourcery 2.2.7 — https://github.com/krzysztofzablocki/Sourcery
// Generated using Sourcery 2.3.0 — https://github.com/krzysztofzablocki/Sourcery
// DO NOT EDIT

// swiftlint:disable all
Expand Down Expand Up @@ -8149,6 +8149,75 @@ open class EncryptionSDKMock: MatrixRustSDK.Encryption, @unchecked Sendable {
}
}

//MARK: - hasDevicesToVerifyAgainst

open var hasDevicesToVerifyAgainstThrowableError: Error?
var hasDevicesToVerifyAgainstUnderlyingCallsCount = 0
open var hasDevicesToVerifyAgainstCallsCount: Int {
get {
if Thread.isMainThread {
return hasDevicesToVerifyAgainstUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = hasDevicesToVerifyAgainstUnderlyingCallsCount
}

return returnValue!
}
}
set {
if Thread.isMainThread {
hasDevicesToVerifyAgainstUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
hasDevicesToVerifyAgainstUnderlyingCallsCount = newValue
}
}
}
}
open var hasDevicesToVerifyAgainstCalled: Bool {
return hasDevicesToVerifyAgainstCallsCount > 0
}

var hasDevicesToVerifyAgainstUnderlyingReturnValue: Bool!
open var hasDevicesToVerifyAgainstReturnValue: Bool! {
get {
if Thread.isMainThread {
return hasDevicesToVerifyAgainstUnderlyingReturnValue
} else {
var returnValue: Bool? = nil
DispatchQueue.main.sync {
returnValue = hasDevicesToVerifyAgainstUnderlyingReturnValue
}

return returnValue!
}
}
set {
if Thread.isMainThread {
hasDevicesToVerifyAgainstUnderlyingReturnValue = newValue
} else {
DispatchQueue.main.sync {
hasDevicesToVerifyAgainstUnderlyingReturnValue = newValue
}
}
}
}
open var hasDevicesToVerifyAgainstClosure: (() async throws -> Bool)?

open override func hasDevicesToVerifyAgainst() async throws -> Bool {
if let error = hasDevicesToVerifyAgainstThrowableError {
throw error
}
hasDevicesToVerifyAgainstCallsCount += 1
if let hasDevicesToVerifyAgainstClosure = hasDevicesToVerifyAgainstClosure {
return try await hasDevicesToVerifyAgainstClosure()
} else {
return hasDevicesToVerifyAgainstReturnValue
}
}

//MARK: - isLastDevice

open var isLastDeviceThrowableError: Error?
Expand Down Expand Up @@ -14289,6 +14358,81 @@ open class RoomSDKMock: MatrixRustSDK.Room, @unchecked Sendable {
}
}

//MARK: - loadOrFetchEvent

open var loadOrFetchEventEventIdThrowableError: Error?
var loadOrFetchEventEventIdUnderlyingCallsCount = 0
open var loadOrFetchEventEventIdCallsCount: Int {
get {
if Thread.isMainThread {
return loadOrFetchEventEventIdUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = loadOrFetchEventEventIdUnderlyingCallsCount
}

return returnValue!
}
}
set {
if Thread.isMainThread {
loadOrFetchEventEventIdUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
loadOrFetchEventEventIdUnderlyingCallsCount = newValue
}
}
}
}
open var loadOrFetchEventEventIdCalled: Bool {
return loadOrFetchEventEventIdCallsCount > 0
}
open var loadOrFetchEventEventIdReceivedEventId: String?
open var loadOrFetchEventEventIdReceivedInvocations: [String] = []

var loadOrFetchEventEventIdUnderlyingReturnValue: TimelineEvent!
open var loadOrFetchEventEventIdReturnValue: TimelineEvent! {
get {
if Thread.isMainThread {
return loadOrFetchEventEventIdUnderlyingReturnValue
} else {
var returnValue: TimelineEvent? = nil
DispatchQueue.main.sync {
returnValue = loadOrFetchEventEventIdUnderlyingReturnValue
}

return returnValue!
}
}
set {
if Thread.isMainThread {
loadOrFetchEventEventIdUnderlyingReturnValue = newValue
} else {
DispatchQueue.main.sync {
loadOrFetchEventEventIdUnderlyingReturnValue = newValue
}
}
}
}
open var loadOrFetchEventEventIdClosure: ((String) async throws -> TimelineEvent)?

open override func loadOrFetchEvent(eventId: String) async throws -> TimelineEvent {
if let error = loadOrFetchEventEventIdThrowableError {
throw error
}
loadOrFetchEventEventIdCallsCount += 1
loadOrFetchEventEventIdReceivedEventId = eventId
DispatchQueue.main.async {
self.loadOrFetchEventEventIdReceivedInvocations.append(eventId)
}
if let loadOrFetchEventEventIdClosure = loadOrFetchEventEventIdClosure {
return try await loadOrFetchEventEventIdClosure(eventId)
} else {
return loadOrFetchEventEventIdReturnValue
}
}

//MARK: - markAsRead

open var markAsReadReceiptTypeThrowableError: Error?
Expand Down Expand Up @@ -25317,6 +25461,71 @@ open class TimelineEventSDKMock: MatrixRustSDK.TimelineEvent, @unchecked Sendabl
}
}

//MARK: - threadRootEventId

var threadRootEventIdUnderlyingCallsCount = 0
open var threadRootEventIdCallsCount: Int {
get {
if Thread.isMainThread {
return threadRootEventIdUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = threadRootEventIdUnderlyingCallsCount
}

return returnValue!
}
}
set {
if Thread.isMainThread {
threadRootEventIdUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
threadRootEventIdUnderlyingCallsCount = newValue
}
}
}
}
open var threadRootEventIdCalled: Bool {
return threadRootEventIdCallsCount > 0
}

var threadRootEventIdUnderlyingReturnValue: String?
open var threadRootEventIdReturnValue: String? {
get {
if Thread.isMainThread {
return threadRootEventIdUnderlyingReturnValue
} else {
var returnValue: String?? = nil
DispatchQueue.main.sync {
returnValue = threadRootEventIdUnderlyingReturnValue
}

return returnValue!
}
}
set {
if Thread.isMainThread {
threadRootEventIdUnderlyingReturnValue = newValue
} else {
DispatchQueue.main.sync {
threadRootEventIdUnderlyingReturnValue = newValue
}
}
}
}
open var threadRootEventIdClosure: (() -> String?)?

open override func threadRootEventId() -> String? {
threadRootEventIdCallsCount += 1
if let threadRootEventIdClosure = threadRootEventIdClosure {
return threadRootEventIdClosure()
} else {
return threadRootEventIdReturnValue
}
}

//MARK: - timestamp

var timestampUnderlyingCallsCount = 0
Expand Down
11 changes: 11 additions & 0 deletions ElementX/Sources/Mocks/RoomSummaryProviderMock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ extension RoomSummary {
joinRequestType: nil,
name: name,
isDirect: false,
isSpace: false,
avatarURL: nil,
heroes: [],
activeMembersCount: 0,
Expand All @@ -101,6 +102,7 @@ extension Array where Element == RoomSummary {
joinRequestType: nil,
name: "Foundation 🔭🪐🌌",
isDirect: false,
isSpace: false,
avatarURL: nil,
heroes: [],
activeMembersCount: 0,
Expand All @@ -121,6 +123,7 @@ extension Array where Element == RoomSummary {
joinRequestType: nil,
name: "Foundation and Empire",
isDirect: false,
isSpace: false,
avatarURL: .mockMXCAvatar,
heroes: [],
activeMembersCount: 0,
Expand All @@ -141,6 +144,7 @@ extension Array where Element == RoomSummary {
joinRequestType: nil,
name: "Second Foundation",
isDirect: false,
isSpace: false,
avatarURL: nil,
heroes: [],
activeMembersCount: 0,
Expand All @@ -161,6 +165,7 @@ extension Array where Element == RoomSummary {
joinRequestType: nil,
name: "Foundation's Edge",
isDirect: false,
isSpace: false,
avatarURL: nil,
heroes: [],
activeMembersCount: 0,
Expand All @@ -181,6 +186,7 @@ extension Array where Element == RoomSummary {
joinRequestType: nil,
name: "Foundation and Earth",
isDirect: true,
isSpace: false,
avatarURL: nil,
heroes: [],
activeMembersCount: 0,
Expand All @@ -201,6 +207,7 @@ extension Array where Element == RoomSummary {
joinRequestType: nil,
name: "Prelude to Foundation",
isDirect: true,
isSpace: false,
avatarURL: nil,
heroes: [],
activeMembersCount: 0,
Expand All @@ -221,6 +228,7 @@ extension Array where Element == RoomSummary {
joinRequestType: nil,
name: "Tombstoned",
isDirect: false,
isSpace: false,
avatarURL: nil,
heroes: [],
activeMembersCount: 0,
Expand All @@ -241,6 +249,7 @@ extension Array where Element == RoomSummary {
joinRequestType: nil,
name: "Unknown",
isDirect: false,
isSpace: false,
avatarURL: nil,
heroes: [],
activeMembersCount: 0,
Expand Down Expand Up @@ -294,6 +303,7 @@ extension Array where Element == RoomSummary {
joinRequestType: .invite(inviter: RoomMemberProxyMock.mockCharlie),
name: "First room",
isDirect: false,
isSpace: false,
avatarURL: .mockMXCAvatar,
heroes: [],
activeMembersCount: 0,
Expand All @@ -314,6 +324,7 @@ extension Array where Element == RoomSummary {
joinRequestType: .invite(inviter: RoomMemberProxyMock.mockCharlie),
name: "Second room",
isDirect: true,
isSpace: false,
avatarURL: nil,
heroes: [],
activeMembersCount: 0,
Expand Down
Loading
Loading