mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Bump the RustSDK to v1.0.14
This commit is contained in:
committed by
Stefan Ceriu
parent
b614f43d00
commit
3bb8d668bf
@@ -7380,7 +7380,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.13;
|
version = 1.0.14;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = {
|
701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = {
|
||||||
|
|||||||
@@ -148,8 +148,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" : "94373ae0568cf1681c39b1a348601e733d76a7ec",
|
"revision" : "76ccbfd106eb4d967c79eccaf339ddfc45e6f7fb",
|
||||||
"version" : "1.0.13"
|
"version" : "1.0.14"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14255,9 +14255,9 @@ open class RoomListSDKMock: MatrixRustSDK.RoomList {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
open var roomRoomIdClosure: ((String) async throws -> RoomListItem)?
|
open var roomRoomIdClosure: ((String) throws -> RoomListItem)?
|
||||||
|
|
||||||
open override func room(roomId: String) async throws -> RoomListItem {
|
open override func room(roomId: String) throws -> RoomListItem {
|
||||||
if let error = roomRoomIdThrowableError {
|
if let error = roomRoomIdThrowableError {
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
@@ -14267,7 +14267,7 @@ open class RoomListSDKMock: MatrixRustSDK.RoomList {
|
|||||||
self.roomRoomIdReceivedInvocations.append(roomId)
|
self.roomRoomIdReceivedInvocations.append(roomId)
|
||||||
}
|
}
|
||||||
if let roomRoomIdClosure = roomRoomIdClosure {
|
if let roomRoomIdClosure = roomRoomIdClosure {
|
||||||
return try await roomRoomIdClosure(roomId)
|
return try roomRoomIdClosure(roomId)
|
||||||
} else {
|
} else {
|
||||||
return roomRoomIdReturnValue
|
return roomRoomIdReturnValue
|
||||||
}
|
}
|
||||||
@@ -15338,9 +15338,9 @@ open class RoomListServiceSDKMock: MatrixRustSDK.RoomListService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
open var roomRoomIdClosure: ((String) async throws -> RoomListItem)?
|
open var roomRoomIdClosure: ((String) throws -> RoomListItem)?
|
||||||
|
|
||||||
open override func room(roomId: String) async throws -> RoomListItem {
|
open override func room(roomId: String) throws -> RoomListItem {
|
||||||
if let error = roomRoomIdThrowableError {
|
if let error = roomRoomIdThrowableError {
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
@@ -15350,7 +15350,7 @@ open class RoomListServiceSDKMock: MatrixRustSDK.RoomListService {
|
|||||||
self.roomRoomIdReceivedInvocations.append(roomId)
|
self.roomRoomIdReceivedInvocations.append(roomId)
|
||||||
}
|
}
|
||||||
if let roomRoomIdClosure = roomRoomIdClosure {
|
if let roomRoomIdClosure = roomRoomIdClosure {
|
||||||
return try await roomRoomIdClosure(roomId)
|
return try roomRoomIdClosure(roomId)
|
||||||
} else {
|
} else {
|
||||||
return roomRoomIdReturnValue
|
return roomRoomIdReturnValue
|
||||||
}
|
}
|
||||||
@@ -17558,71 +17558,6 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//MARK: - latestEvent
|
|
||||||
|
|
||||||
var latestEventUnderlyingCallsCount = 0
|
|
||||||
open var latestEventCallsCount: Int {
|
|
||||||
get {
|
|
||||||
if Thread.isMainThread {
|
|
||||||
return latestEventUnderlyingCallsCount
|
|
||||||
} else {
|
|
||||||
var returnValue: Int? = nil
|
|
||||||
DispatchQueue.main.sync {
|
|
||||||
returnValue = latestEventUnderlyingCallsCount
|
|
||||||
}
|
|
||||||
|
|
||||||
return returnValue!
|
|
||||||
}
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
if Thread.isMainThread {
|
|
||||||
latestEventUnderlyingCallsCount = newValue
|
|
||||||
} else {
|
|
||||||
DispatchQueue.main.sync {
|
|
||||||
latestEventUnderlyingCallsCount = newValue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
open var latestEventCalled: Bool {
|
|
||||||
return latestEventCallsCount > 0
|
|
||||||
}
|
|
||||||
|
|
||||||
var latestEventUnderlyingReturnValue: EventTimelineItem?
|
|
||||||
open var latestEventReturnValue: EventTimelineItem? {
|
|
||||||
get {
|
|
||||||
if Thread.isMainThread {
|
|
||||||
return latestEventUnderlyingReturnValue
|
|
||||||
} else {
|
|
||||||
var returnValue: EventTimelineItem?? = nil
|
|
||||||
DispatchQueue.main.sync {
|
|
||||||
returnValue = latestEventUnderlyingReturnValue
|
|
||||||
}
|
|
||||||
|
|
||||||
return returnValue!
|
|
||||||
}
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
if Thread.isMainThread {
|
|
||||||
latestEventUnderlyingReturnValue = newValue
|
|
||||||
} else {
|
|
||||||
DispatchQueue.main.sync {
|
|
||||||
latestEventUnderlyingReturnValue = newValue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
open var latestEventClosure: (() async -> EventTimelineItem?)?
|
|
||||||
|
|
||||||
open override func latestEvent() async -> EventTimelineItem? {
|
|
||||||
latestEventCallsCount += 1
|
|
||||||
if let latestEventClosure = latestEventClosure {
|
|
||||||
return await latestEventClosure()
|
|
||||||
} else {
|
|
||||||
return latestEventReturnValue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//MARK: - loadReplyDetails
|
//MARK: - loadReplyDetails
|
||||||
|
|
||||||
open var loadReplyDetailsEventIdStrThrowableError: Error?
|
open var loadReplyDetailsEventIdStrThrowableError: Error?
|
||||||
|
|||||||
@@ -820,7 +820,7 @@ class ClientProxy: ClientProxyProtocol {
|
|||||||
|
|
||||||
private func roomTupleForIdentifier(_ identifier: String) async -> (RoomListItem?, Room?) {
|
private func roomTupleForIdentifier(_ identifier: String) async -> (RoomListItem?, Room?) {
|
||||||
do {
|
do {
|
||||||
let roomListItem = try await roomListService?.room(roomId: identifier)
|
let roomListItem = try roomListService?.room(roomId: identifier)
|
||||||
if roomListItem?.isTimelineInitialized() == false {
|
if roomListItem?.isTimelineInitialized() == false {
|
||||||
try await roomListItem?.initTimeline(eventTypeFilter: eventFilters, internalIdPrefix: nil)
|
try await roomListItem?.initTimeline(eventTypeFilter: eventFilters, internalIdPrefix: nil)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -200,9 +200,10 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
|
|||||||
return updatedItems
|
return updatedItems
|
||||||
}
|
}
|
||||||
|
|
||||||
private func fetchRoomInfo(roomID: String) -> RoomInfo? {
|
private func fetchRoomDetails(roomID: String) -> (roomInfo: RoomInfo?, latestEvent: EventTimelineItem?) {
|
||||||
class FetchResult {
|
class FetchResult {
|
||||||
var roomInfo: RoomInfo?
|
var roomInfo: RoomInfo?
|
||||||
|
var latestEvent: EventTimelineItem?
|
||||||
}
|
}
|
||||||
|
|
||||||
let semaphore = DispatchSemaphore(value: 0)
|
let semaphore = DispatchSemaphore(value: 0)
|
||||||
@@ -210,7 +211,8 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
|
|||||||
|
|
||||||
Task {
|
Task {
|
||||||
do {
|
do {
|
||||||
let roomListItem = try await roomListService.room(roomId: roomID)
|
let roomListItem = try roomListService.room(roomId: roomID)
|
||||||
|
result.latestEvent = await roomListItem.latestEvent()
|
||||||
result.roomInfo = try await roomListItem.roomInfo()
|
result.roomInfo = try await roomListItem.roomInfo()
|
||||||
} catch {
|
} catch {
|
||||||
MXLog.error("Failed fetching room info with error: \(error)")
|
MXLog.error("Failed fetching room info with error: \(error)")
|
||||||
@@ -218,18 +220,20 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
|
|||||||
semaphore.signal()
|
semaphore.signal()
|
||||||
}
|
}
|
||||||
semaphore.wait()
|
semaphore.wait()
|
||||||
return result.roomInfo
|
return (result.roomInfo, result.latestEvent)
|
||||||
}
|
}
|
||||||
|
|
||||||
private func buildRoomSummaryForIdentifier(_ identifier: String, invalidated: Bool) -> RoomSummary {
|
private func buildRoomSummaryForIdentifier(_ identifier: String, invalidated: Bool) -> RoomSummary {
|
||||||
guard let roomInfo = fetchRoomInfo(roomID: identifier) else {
|
let roomDetails = fetchRoomDetails(roomID: identifier)
|
||||||
|
|
||||||
|
guard let roomInfo = roomDetails.roomInfo else {
|
||||||
return .empty
|
return .empty
|
||||||
}
|
}
|
||||||
|
|
||||||
var attributedLastMessage: AttributedString?
|
var attributedLastMessage: AttributedString?
|
||||||
var lastMessageFormattedTimestamp: String?
|
var lastMessageFormattedTimestamp: String?
|
||||||
|
|
||||||
if let latestRoomMessage = roomInfo.latestEvent {
|
if let latestRoomMessage = roomDetails.latestEvent {
|
||||||
let lastMessage = EventTimelineItemProxy(item: latestRoomMessage, id: "0")
|
let lastMessage = EventTimelineItemProxy(item: latestRoomMessage, id: "0")
|
||||||
lastMessageFormattedTimestamp = lastMessage.timestamp.formattedMinimal()
|
lastMessageFormattedTimestamp = lastMessage.timestamp.formattedMinimal()
|
||||||
attributedLastMessage = eventStringBuilder.buildAttributedString(for: lastMessage)
|
attributedLastMessage = eventStringBuilder.buildAttributedString(for: lastMessage)
|
||||||
|
|||||||
+1
-1
@@ -49,7 +49,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.13
|
exactVersion: 1.0.14
|
||||||
# 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