Skip to content

Commit 3047d2b

Browse files
committed
Bump to version 24.12.20 (matrix-rust-sdk/main 667a8e6)
1 parent 0d20974 commit 3047d2b

File tree

2 files changed

+83
-28
lines changed

2 files changed

+83
-28
lines changed

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// swift-tools-version:5.9
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33
import PackageDescription
4-
let checksum = "47436d66c942b81d8b97e42935f4fe4ad8eda0a5d5bc1717e9f920b404265bf5"
5-
let version = "v1.0.83"
4+
let checksum = "251ddc897a168cb5ff0a0b12b8211b245a8fb0786441a456ce90650d3906a9ef"
5+
let version = "24.12.20"
66
let url = "https://github.com/element-hq/matrix-rust-components-swift/releases/download/\(version)/MatrixSDKFFI.xcframework.zip"
77
let package = Package(
88
name: "MatrixRustSDK",

Sources/MatrixRustSDK/matrix_sdk_ffi.swift

Lines changed: 81 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10881,7 +10881,7 @@ public protocol TimelineEventProtocol : AnyObject {
1088110881

1088210882
func senderId() -> String
1088310883

10884-
func timestamp() -> UInt64
10884+
func timestamp() -> Timestamp
1088510885

1088610886
}
1088710887

@@ -10947,8 +10947,8 @@ open func senderId() -> String {
1094710947
})
1094810948
}
1094910949

10950-
open func timestamp() -> UInt64 {
10951-
return try! FfiConverterUInt64.lift(try! rustCall() {
10950+
open func timestamp() -> Timestamp {
10951+
return try! FfiConverterTypeTimestamp.lift(try! rustCall() {
1095210952
uniffi_matrix_sdk_ffi_fn_method_timelineevent_timestamp(self.uniffiClonePointer(),$0
1095310953
)
1095410954
})
@@ -12529,7 +12529,7 @@ public struct EventTimelineItem {
1252912529
public var isOwn: Bool
1253012530
public var isEditable: Bool
1253112531
public var content: TimelineItemContent
12532-
public var timestamp: UInt64
12532+
public var timestamp: Timestamp
1253312533
public var reactions: [Reaction]
1253412534
public var localSendState: EventSendState?
1253512535
public var readReceipts: [String: Receipt]
@@ -12542,7 +12542,7 @@ public struct EventTimelineItem {
1254212542
public init(
1254312543
/**
1254412544
* Indicates that an event is remote.
12545-
*/isRemote: Bool, eventOrTransactionId: EventOrTransactionId, sender: String, senderProfile: ProfileDetails, isOwn: Bool, isEditable: Bool, content: TimelineItemContent, timestamp: UInt64, reactions: [Reaction], localSendState: EventSendState?, readReceipts: [String: Receipt], origin: EventItemOrigin?, canBeRepliedTo: Bool, lazyProvider: LazyTimelineItemProvider) {
12545+
*/isRemote: Bool, eventOrTransactionId: EventOrTransactionId, sender: String, senderProfile: ProfileDetails, isOwn: Bool, isEditable: Bool, content: TimelineItemContent, timestamp: Timestamp, reactions: [Reaction], localSendState: EventSendState?, readReceipts: [String: Receipt], origin: EventItemOrigin?, canBeRepliedTo: Bool, lazyProvider: LazyTimelineItemProvider) {
1254612546
self.isRemote = isRemote
1254712547
self.eventOrTransactionId = eventOrTransactionId
1254812548
self.sender = sender
@@ -12573,7 +12573,7 @@ public struct FfiConverterTypeEventTimelineItem: FfiConverterRustBuffer {
1257312573
isOwn: FfiConverterBool.read(from: &buf),
1257412574
isEditable: FfiConverterBool.read(from: &buf),
1257512575
content: FfiConverterTypeTimelineItemContent.read(from: &buf),
12576-
timestamp: FfiConverterUInt64.read(from: &buf),
12576+
timestamp: FfiConverterTypeTimestamp.read(from: &buf),
1257712577
reactions: FfiConverterSequenceTypeReaction.read(from: &buf),
1257812578
localSendState: FfiConverterOptionTypeEventSendState.read(from: &buf),
1257912579
readReceipts: FfiConverterDictionaryStringTypeReceipt.read(from: &buf),
@@ -12591,7 +12591,7 @@ public struct FfiConverterTypeEventTimelineItem: FfiConverterRustBuffer {
1259112591
FfiConverterBool.write(value.isOwn, into: &buf)
1259212592
FfiConverterBool.write(value.isEditable, into: &buf)
1259312593
FfiConverterTypeTimelineItemContent.write(value.content, into: &buf)
12594-
FfiConverterUInt64.write(value.timestamp, into: &buf)
12594+
FfiConverterTypeTimestamp.write(value.timestamp, into: &buf)
1259512595
FfiConverterSequenceTypeReaction.write(value.reactions, into: &buf)
1259612596
FfiConverterOptionTypeEventSendState.write(value.localSendState, into: &buf)
1259712597
FfiConverterDictionaryStringTypeReceipt.write(value.readReceipts, into: &buf)
@@ -14427,11 +14427,11 @@ public func FfiConverterTypeReaction_lower(_ value: Reaction) -> RustBuffer {
1442714427

1442814428
public struct ReactionSenderData {
1442914429
public var senderId: String
14430-
public var timestamp: UInt64
14430+
public var timestamp: Timestamp
1443114431

1443214432
// Default memberwise initializers are never public by default, so we
1443314433
// declare one manually.
14434-
public init(senderId: String, timestamp: UInt64) {
14434+
public init(senderId: String, timestamp: Timestamp) {
1443514435
self.senderId = senderId
1443614436
self.timestamp = timestamp
1443714437
}
@@ -14462,13 +14462,13 @@ public struct FfiConverterTypeReactionSenderData: FfiConverterRustBuffer {
1446214462
return
1446314463
try ReactionSenderData(
1446414464
senderId: FfiConverterString.read(from: &buf),
14465-
timestamp: FfiConverterUInt64.read(from: &buf)
14465+
timestamp: FfiConverterTypeTimestamp.read(from: &buf)
1446614466
)
1446714467
}
1446814468

1446914469
public static func write(_ value: ReactionSenderData, into buf: inout [UInt8]) {
1447014470
FfiConverterString.write(value.senderId, into: &buf)
14471-
FfiConverterUInt64.write(value.timestamp, into: &buf)
14471+
FfiConverterTypeTimestamp.write(value.timestamp, into: &buf)
1447214472
}
1447314473
}
1447414474

@@ -14483,11 +14483,11 @@ public func FfiConverterTypeReactionSenderData_lower(_ value: ReactionSenderData
1448314483

1448414484

1448514485
public struct Receipt {
14486-
public var timestamp: UInt64?
14486+
public var timestamp: Timestamp?
1448714487

1448814488
// Default memberwise initializers are never public by default, so we
1448914489
// declare one manually.
14490-
public init(timestamp: UInt64?) {
14490+
public init(timestamp: Timestamp?) {
1449114491
self.timestamp = timestamp
1449214492
}
1449314493
}
@@ -14512,12 +14512,12 @@ public struct FfiConverterTypeReceipt: FfiConverterRustBuffer {
1451214512
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Receipt {
1451314513
return
1451414514
try Receipt(
14515-
timestamp: FfiConverterOptionUInt64.read(from: &buf)
14515+
timestamp: FfiConverterOptionTypeTimestamp.read(from: &buf)
1451614516
)
1451714517
}
1451814518

1451914519
public static func write(_ value: Receipt, into buf: inout [UInt8]) {
14520-
FfiConverterOptionUInt64.write(value.timestamp, into: &buf)
14520+
FfiConverterOptionTypeTimestamp.write(value.timestamp, into: &buf)
1452114521
}
1452214522
}
1452314523

@@ -16132,14 +16132,14 @@ public struct SessionVerificationRequestDetails {
1613216132
/**
1613316133
* First time this device was seen in milliseconds since epoch.
1613416134
*/
16135-
public var firstSeenTimestamp: UInt64
16135+
public var firstSeenTimestamp: Timestamp
1613616136

1613716137
// Default memberwise initializers are never public by default, so we
1613816138
// declare one manually.
1613916139
public init(senderId: String, flowId: String, deviceId: String, displayName: String?,
1614016140
/**
1614116141
* First time this device was seen in milliseconds since epoch.
16142-
*/firstSeenTimestamp: UInt64) {
16142+
*/firstSeenTimestamp: Timestamp) {
1614316143
self.senderId = senderId
1614416144
self.flowId = flowId
1614516145
self.deviceId = deviceId
@@ -16188,7 +16188,7 @@ public struct FfiConverterTypeSessionVerificationRequestDetails: FfiConverterRus
1618816188
flowId: FfiConverterString.read(from: &buf),
1618916189
deviceId: FfiConverterString.read(from: &buf),
1619016190
displayName: FfiConverterOptionString.read(from: &buf),
16191-
firstSeenTimestamp: FfiConverterUInt64.read(from: &buf)
16191+
firstSeenTimestamp: FfiConverterTypeTimestamp.read(from: &buf)
1619216192
)
1619316193
}
1619416194

@@ -16197,7 +16197,7 @@ public struct FfiConverterTypeSessionVerificationRequestDetails: FfiConverterRus
1619716197
FfiConverterString.write(value.flowId, into: &buf)
1619816198
FfiConverterString.write(value.deviceId, into: &buf)
1619916199
FfiConverterOptionString.write(value.displayName, into: &buf)
16200-
FfiConverterUInt64.write(value.firstSeenTimestamp, into: &buf)
16200+
FfiConverterTypeTimestamp.write(value.firstSeenTimestamp, into: &buf)
1620116201
}
1620216202
}
1620316203

@@ -24652,7 +24652,7 @@ public enum TimelineItemContent {
2465224652
case redactedMessage
2465324653
case sticker(body: String, info: ImageInfo, source: MediaSource
2465424654
)
24655-
case poll(question: String, kind: PollKind, maxSelections: UInt64, answers: [PollAnswer], votes: [String: [String]], endTime: UInt64?, hasBeenEdited: Bool
24655+
case poll(question: String, kind: PollKind, maxSelections: UInt64, answers: [PollAnswer], votes: [String: [String]], endTime: Timestamp?, hasBeenEdited: Bool
2465624656
)
2465724657
case callInvite
2465824658
case callNotify
@@ -24686,7 +24686,7 @@ public struct FfiConverterTypeTimelineItemContent: FfiConverterRustBuffer {
2468624686
case 3: return .sticker(body: try FfiConverterString.read(from: &buf), info: try FfiConverterTypeImageInfo.read(from: &buf), source: try FfiConverterTypeMediaSource.read(from: &buf)
2468724687
)
2468824688

24689-
case 4: return .poll(question: try FfiConverterString.read(from: &buf), kind: try FfiConverterTypePollKind.read(from: &buf), maxSelections: try FfiConverterUInt64.read(from: &buf), answers: try FfiConverterSequenceTypePollAnswer.read(from: &buf), votes: try FfiConverterDictionaryStringSequenceString.read(from: &buf), endTime: try FfiConverterOptionUInt64.read(from: &buf), hasBeenEdited: try FfiConverterBool.read(from: &buf)
24689+
case 4: return .poll(question: try FfiConverterString.read(from: &buf), kind: try FfiConverterTypePollKind.read(from: &buf), maxSelections: try FfiConverterUInt64.read(from: &buf), answers: try FfiConverterSequenceTypePollAnswer.read(from: &buf), votes: try FfiConverterDictionaryStringSequenceString.read(from: &buf), endTime: try FfiConverterOptionTypeTimestamp.read(from: &buf), hasBeenEdited: try FfiConverterBool.read(from: &buf)
2469024690
)
2469124691

2469224692
case 5: return .callInvite
@@ -24742,7 +24742,7 @@ public struct FfiConverterTypeTimelineItemContent: FfiConverterRustBuffer {
2474224742
FfiConverterUInt64.write(maxSelections, into: &buf)
2474324743
FfiConverterSequenceTypePollAnswer.write(answers, into: &buf)
2474424744
FfiConverterDictionaryStringSequenceString.write(votes, into: &buf)
24745-
FfiConverterOptionUInt64.write(endTime, into: &buf)
24745+
FfiConverterOptionTypeTimestamp.write(endTime, into: &buf)
2474624746
FfiConverterBool.write(hasBeenEdited, into: &buf)
2474724747

2474824748

@@ -24887,7 +24887,7 @@ public enum VirtualTimelineItem {
2488724887
/**
2488824888
* A timestamp in milliseconds since Unix Epoch on that day in local
2488924889
* time.
24890-
*/ts: UInt64
24890+
*/ts: Timestamp
2489124891
)
2489224892
/**
2489324893
* The user's own read marker.
@@ -24903,7 +24903,7 @@ public struct FfiConverterTypeVirtualTimelineItem: FfiConverterRustBuffer {
2490324903
let variant: Int32 = try readInt(&buf)
2490424904
switch variant {
2490524905

24906-
case 1: return .dateDivider(ts: try FfiConverterUInt64.read(from: &buf)
24906+
case 1: return .dateDivider(ts: try FfiConverterTypeTimestamp.read(from: &buf)
2490724907
)
2490824908

2490924909
case 2: return .readMarker
@@ -24918,7 +24918,7 @@ public struct FfiConverterTypeVirtualTimelineItem: FfiConverterRustBuffer {
2491824918

2491924919
case let .dateDivider(ts):
2492024920
writeInt(&buf, Int32(1))
24921-
FfiConverterUInt64.write(ts, into: &buf)
24921+
FfiConverterTypeTimestamp.write(ts, into: &buf)
2492224922

2492324923

2492424924
case .readMarker:
@@ -28745,6 +28745,27 @@ fileprivate struct FfiConverterOptionTypeEventItemOrigin: FfiConverterRustBuffer
2874528745
}
2874628746
}
2874728747

28748+
fileprivate struct FfiConverterOptionTypeTimestamp: FfiConverterRustBuffer {
28749+
typealias SwiftType = Timestamp?
28750+
28751+
public static func write(_ value: SwiftType, into buf: inout [UInt8]) {
28752+
guard let value = value else {
28753+
writeInt(&buf, Int8(0))
28754+
return
28755+
}
28756+
writeInt(&buf, Int8(1))
28757+
FfiConverterTypeTimestamp.write(value, into: &buf)
28758+
}
28759+
28760+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType {
28761+
switch try readInt(&buf) as Int8 {
28762+
case 0: return nil
28763+
case 1: return try FfiConverterTypeTimestamp.read(from: &buf)
28764+
default: throw UniffiInternalError.unexpectedOptionalTag
28765+
}
28766+
}
28767+
}
28768+
2874828769
fileprivate struct FfiConverterSequenceUInt16: FfiConverterRustBuffer {
2874928770
typealias SwiftType = [UInt16]
2875028771

@@ -29498,6 +29519,40 @@ fileprivate struct FfiConverterDictionaryStringSequenceString: FfiConverterRustB
2949829519

2949929520

2950029521

29522+
29523+
29524+
29525+
/**
29526+
* Typealias from the type name used in the UDL file to the builtin type. This
29527+
* is needed because the UDL type name is used in function/method signatures.
29528+
*/
29529+
public typealias Timestamp = UInt64
29530+
public struct FfiConverterTypeTimestamp: FfiConverter {
29531+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Timestamp {
29532+
return try FfiConverterUInt64.read(from: &buf)
29533+
}
29534+
29535+
public static func write(_ value: Timestamp, into buf: inout [UInt8]) {
29536+
return FfiConverterUInt64.write(value, into: &buf)
29537+
}
29538+
29539+
public static func lift(_ value: UInt64) throws -> Timestamp {
29540+
return try FfiConverterUInt64.lift(value)
29541+
}
29542+
29543+
public static func lower(_ value: Timestamp) -> UInt64 {
29544+
return FfiConverterUInt64.lower(value)
29545+
}
29546+
}
29547+
29548+
29549+
public func FfiConverterTypeTimestamp_lift(_ value: UInt64) throws -> Timestamp {
29550+
return try FfiConverterTypeTimestamp.lift(value)
29551+
}
29552+
29553+
public func FfiConverterTypeTimestamp_lower(_ value: Timestamp) -> UInt64 {
29554+
return FfiConverterTypeTimestamp.lower(value)
29555+
}
2950129556

2950229557
private let UNIFFI_RUST_FUTURE_POLL_READY: Int8 = 0
2950329558
private let UNIFFI_RUST_FUTURE_POLL_MAYBE_READY: Int8 = 1
@@ -30917,7 +30972,7 @@ private var initializationResult: InitializationResult = {
3091730972
if (uniffi_matrix_sdk_ffi_checksum_method_timelineevent_sender_id() != 18142) {
3091830973
return InitializationResult.apiChecksumMismatch
3091930974
}
30920-
if (uniffi_matrix_sdk_ffi_checksum_method_timelineevent_timestamp() != 58123) {
30975+
if (uniffi_matrix_sdk_ffi_checksum_method_timelineevent_timestamp() != 50929) {
3092130976
return InitializationResult.apiChecksumMismatch
3092230977
}
3092330978
if (uniffi_matrix_sdk_ffi_checksum_method_timelineitem_as_event() != 6106) {

0 commit comments

Comments
 (0)