Skip to content

Commit

Permalink
updated the SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
Velin92 committed Aug 5, 2024
1 parent 51923bc commit 10702ce
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 31 deletions.
2 changes: 1 addition & 1 deletion ElementX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7553,7 +7553,7 @@
repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift";
requirement = {
kind = exactVersion;
version = 1.0.30;
version = 1.0.31;
};
};
701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/element-hq/matrix-rust-components-swift",
"state" : {
"revision" : "bc534e15fa0749d668b201b923ee57204afb868a",
"version" : "1.0.30"
"revision" : "8e2b4049fb492dcf5b0c796784b7aa7a3c099943",
"version" : "1.0.31"
}
},
{
Expand Down
88 changes: 62 additions & 26 deletions ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10989,6 +10989,42 @@ open class RoomSDKMock: MatrixRustSDK.Room {
try await clearComposerDraftClosure?()
}

//MARK: - clearPinnedEventsCache

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

return returnValue!
}
}
set {
if Thread.isMainThread {
clearPinnedEventsCacheUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
clearPinnedEventsCacheUnderlyingCallsCount = newValue
}
}
}
}
open var clearPinnedEventsCacheCalled: Bool {
return clearPinnedEventsCacheCallsCount > 0
}
open var clearPinnedEventsCacheClosure: (() async -> Void)?

open override func clearPinnedEventsCache() async {
clearPinnedEventsCacheCallsCount += 1
await clearPinnedEventsCacheClosure?()
}

//MARK: - discardRoomKey

open var discardRoomKeyThrowableError: Error?
Expand Down Expand Up @@ -13007,76 +13043,76 @@ open class RoomSDKMock: MatrixRustSDK.Room {

//MARK: - pinnedEventsTimeline

open var pinnedEventsTimelineInternalIdPrefixThrowableError: Error?
var pinnedEventsTimelineInternalIdPrefixUnderlyingCallsCount = 0
open var pinnedEventsTimelineInternalIdPrefixCallsCount: Int {
open var pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadThrowableError: Error?
var pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadUnderlyingCallsCount = 0
open var pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadCallsCount: Int {
get {
if Thread.isMainThread {
return pinnedEventsTimelineInternalIdPrefixUnderlyingCallsCount
return pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = pinnedEventsTimelineInternalIdPrefixUnderlyingCallsCount
returnValue = pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadUnderlyingCallsCount
}

return returnValue!
}
}
set {
if Thread.isMainThread {
pinnedEventsTimelineInternalIdPrefixUnderlyingCallsCount = newValue
pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
pinnedEventsTimelineInternalIdPrefixUnderlyingCallsCount = newValue
pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadUnderlyingCallsCount = newValue
}
}
}
}
open var pinnedEventsTimelineInternalIdPrefixCalled: Bool {
return pinnedEventsTimelineInternalIdPrefixCallsCount > 0
open var pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadCalled: Bool {
return pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadCallsCount > 0
}
open var pinnedEventsTimelineInternalIdPrefixReceivedInternalIdPrefix: String?
open var pinnedEventsTimelineInternalIdPrefixReceivedInvocations: [String?] = []
open var pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadReceivedArguments: (internalIdPrefix: String?, maxEventsToLoad: UInt16)?
open var pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadReceivedInvocations: [(internalIdPrefix: String?, maxEventsToLoad: UInt16)] = []

var pinnedEventsTimelineInternalIdPrefixUnderlyingReturnValue: Timeline!
open var pinnedEventsTimelineInternalIdPrefixReturnValue: Timeline! {
var pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadUnderlyingReturnValue: Timeline!
open var pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadReturnValue: Timeline! {
get {
if Thread.isMainThread {
return pinnedEventsTimelineInternalIdPrefixUnderlyingReturnValue
return pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadUnderlyingReturnValue
} else {
var returnValue: Timeline? = nil
DispatchQueue.main.sync {
returnValue = pinnedEventsTimelineInternalIdPrefixUnderlyingReturnValue
returnValue = pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadUnderlyingReturnValue
}

return returnValue!
}
}
set {
if Thread.isMainThread {
pinnedEventsTimelineInternalIdPrefixUnderlyingReturnValue = newValue
pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadUnderlyingReturnValue = newValue
} else {
DispatchQueue.main.sync {
pinnedEventsTimelineInternalIdPrefixUnderlyingReturnValue = newValue
pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadUnderlyingReturnValue = newValue
}
}
}
}
open var pinnedEventsTimelineInternalIdPrefixClosure: ((String?) async throws -> Timeline)?
open var pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadClosure: ((String?, UInt16) async throws -> Timeline)?

open override func pinnedEventsTimeline(internalIdPrefix: String?) async throws -> Timeline {
if let error = pinnedEventsTimelineInternalIdPrefixThrowableError {
open override func pinnedEventsTimeline(internalIdPrefix: String?, maxEventsToLoad: UInt16) async throws -> Timeline {
if let error = pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadThrowableError {
throw error
}
pinnedEventsTimelineInternalIdPrefixCallsCount += 1
pinnedEventsTimelineInternalIdPrefixReceivedInternalIdPrefix = internalIdPrefix
pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadCallsCount += 1
pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadReceivedArguments = (internalIdPrefix: internalIdPrefix, maxEventsToLoad: maxEventsToLoad)
DispatchQueue.main.async {
self.pinnedEventsTimelineInternalIdPrefixReceivedInvocations.append(internalIdPrefix)
self.pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadReceivedInvocations.append((internalIdPrefix: internalIdPrefix, maxEventsToLoad: maxEventsToLoad))
}
if let pinnedEventsTimelineInternalIdPrefixClosure = pinnedEventsTimelineInternalIdPrefixClosure {
return try await pinnedEventsTimelineInternalIdPrefixClosure(internalIdPrefix)
if let pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadClosure = pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadClosure {
return try await pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadClosure(internalIdPrefix, maxEventsToLoad)
} else {
return pinnedEventsTimelineInternalIdPrefixReturnValue
return pinnedEventsTimelineInternalIdPrefixMaxEventsToLoadReturnValue
}
}

Expand Down
2 changes: 1 addition & 1 deletion ElementX/Sources/Services/Room/RoomProxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class RoomProxy: RoomProxyProtocol {
return innerPinnedEventsTimeline
} else {
do {
let timeline = try await TimelineProxy(timeline: room.pinnedEventsTimeline(internalIdPrefix: nil), isLive: false)
let timeline = try await TimelineProxy(timeline: room.pinnedEventsTimeline(internalIdPrefix: nil, maxEventsToLoad: 100), isLive: false)
await timeline.subscribeForUpdates()
innerPinnedEventsTimeline = timeline
return timeline
Expand Down
2 changes: 1 addition & 1 deletion project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ packages:
# Element/Matrix dependencies
MatrixRustSDK:
url: https://github.com/element-hq/matrix-rust-components-swift
exactVersion: 1.0.30
exactVersion: 1.0.31
# path: ../matrix-rust-sdk
Compound:
url: https://github.com/element-hq/compound-ios
Expand Down

0 comments on commit 10702ce

Please sign in to comment.