Skip to content

Commit 6045ecd

Browse files
committed
Bump to v1.1.58 (matrix-rust-sdk/main 7c68096237f8b3f36781a648f60eb3188ba6678b)
1 parent e50657b commit 6045ecd

File tree

2 files changed

+207
-2
lines changed

2 files changed

+207
-2
lines changed

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
import PackageDescription
55

6-
let checksum = "99129401316b7bbcf5de138cb01d4e3953e9302b665aec3195c176d98d7274ae"
7-
let version = "v1.1.57"
6+
let checksum = "0f23dd6b3ed379cac1a7462a64a3e3653fffa0309b9cd351fb87c40dd780d4b2"
7+
let version = "v1.1.58"
88
let url = "https://github.com/matrix-org/matrix-rust-components-swift/releases/download/\(version)/MatrixSDKFFI.xcframework.zip"
99

1010
let package = Package(

Sources/MatrixRustSDK/matrix_sdk_ffi.swift

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10051,6 +10051,66 @@ public func FfiConverterTypeLocationContent_lower(_ value: LocationContent) -> R
1005110051
}
1005210052

1005310053

10054+
/**
10055+
* A Matrix entity that can be a room, room alias, user, or event, and a list
10056+
* of via servers.
10057+
*/
10058+
public struct MatrixEntity {
10059+
public var id: MatrixId
10060+
public var via: [String]
10061+
10062+
// Default memberwise initializers are never public by default, so we
10063+
// declare one manually.
10064+
public init(id: MatrixId, via: [String]) {
10065+
self.id = id
10066+
self.via = via
10067+
}
10068+
}
10069+
10070+
10071+
extension MatrixEntity: Equatable, Hashable {
10072+
public static func ==(lhs: MatrixEntity, rhs: MatrixEntity) -> Bool {
10073+
if lhs.id != rhs.id {
10074+
return false
10075+
}
10076+
if lhs.via != rhs.via {
10077+
return false
10078+
}
10079+
return true
10080+
}
10081+
10082+
public func hash(into hasher: inout Hasher) {
10083+
hasher.combine(id)
10084+
hasher.combine(via)
10085+
}
10086+
}
10087+
10088+
10089+
public struct FfiConverterTypeMatrixEntity: FfiConverterRustBuffer {
10090+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MatrixEntity {
10091+
return
10092+
try MatrixEntity(
10093+
id: FfiConverterTypeMatrixId.read(from: &buf),
10094+
via: FfiConverterSequenceString.read(from: &buf)
10095+
)
10096+
}
10097+
10098+
public static func write(_ value: MatrixEntity, into buf: inout [UInt8]) {
10099+
FfiConverterTypeMatrixId.write(value.id, into: &buf)
10100+
FfiConverterSequenceString.write(value.via, into: &buf)
10101+
}
10102+
}
10103+
10104+
10105+
public func FfiConverterTypeMatrixEntity_lift(_ buf: RustBuffer) throws -> MatrixEntity {
10106+
return try FfiConverterTypeMatrixEntity.lift(buf)
10107+
}
10108+
10109+
public func FfiConverterTypeMatrixEntity_lower(_ value: MatrixEntity) -> RustBuffer {
10110+
return FfiConverterTypeMatrixEntity.lower(value)
10111+
}
10112+
10113+
1005410114
public struct Mentions {
1005510115
public var userIds: [String]
1005610116
public var room: Bool
@@ -14602,6 +14662,101 @@ extension LogLevel: Equatable, Hashable {}
1460214662

1460314663

1460414664

14665+
// Note that we don't yet support `indirect` for enums.
14666+
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
14667+
/**
14668+
* A Matrix ID that can be a room, room alias, user, or event.
14669+
*/
14670+
14671+
public enum MatrixId {
14672+
14673+
case room(id: String
14674+
)
14675+
case roomAlias(alias: String
14676+
)
14677+
case user(id: String
14678+
)
14679+
case eventOnRoomId(roomId: String, eventId: String
14680+
)
14681+
case eventOnRoomAlias(alias: String, eventId: String
14682+
)
14683+
}
14684+
14685+
14686+
public struct FfiConverterTypeMatrixId: FfiConverterRustBuffer {
14687+
typealias SwiftType = MatrixId
14688+
14689+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MatrixId {
14690+
let variant: Int32 = try readInt(&buf)
14691+
switch variant {
14692+
14693+
case 1: return .room(id: try FfiConverterString.read(from: &buf)
14694+
)
14695+
14696+
case 2: return .roomAlias(alias: try FfiConverterString.read(from: &buf)
14697+
)
14698+
14699+
case 3: return .user(id: try FfiConverterString.read(from: &buf)
14700+
)
14701+
14702+
case 4: return .eventOnRoomId(roomId: try FfiConverterString.read(from: &buf), eventId: try FfiConverterString.read(from: &buf)
14703+
)
14704+
14705+
case 5: return .eventOnRoomAlias(alias: try FfiConverterString.read(from: &buf), eventId: try FfiConverterString.read(from: &buf)
14706+
)
14707+
14708+
default: throw UniffiInternalError.unexpectedEnumCase
14709+
}
14710+
}
14711+
14712+
public static func write(_ value: MatrixId, into buf: inout [UInt8]) {
14713+
switch value {
14714+
14715+
14716+
case let .room(id):
14717+
writeInt(&buf, Int32(1))
14718+
FfiConverterString.write(id, into: &buf)
14719+
14720+
14721+
case let .roomAlias(alias):
14722+
writeInt(&buf, Int32(2))
14723+
FfiConverterString.write(alias, into: &buf)
14724+
14725+
14726+
case let .user(id):
14727+
writeInt(&buf, Int32(3))
14728+
FfiConverterString.write(id, into: &buf)
14729+
14730+
14731+
case let .eventOnRoomId(roomId,eventId):
14732+
writeInt(&buf, Int32(4))
14733+
FfiConverterString.write(roomId, into: &buf)
14734+
FfiConverterString.write(eventId, into: &buf)
14735+
14736+
14737+
case let .eventOnRoomAlias(alias,eventId):
14738+
writeInt(&buf, Int32(5))
14739+
FfiConverterString.write(alias, into: &buf)
14740+
FfiConverterString.write(eventId, into: &buf)
14741+
14742+
}
14743+
}
14744+
}
14745+
14746+
14747+
public func FfiConverterTypeMatrixId_lift(_ buf: RustBuffer) throws -> MatrixId {
14748+
return try FfiConverterTypeMatrixId.lift(buf)
14749+
}
14750+
14751+
public func FfiConverterTypeMatrixId_lower(_ value: MatrixId) -> RustBuffer {
14752+
return FfiConverterTypeMatrixId.lower(value)
14753+
}
14754+
14755+
14756+
extension MatrixId: Equatable, Hashable {}
14757+
14758+
14759+
1460514760
// Note that we don't yet support `indirect` for enums.
1460614761
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
1460714762

@@ -21573,6 +21728,27 @@ fileprivate struct FfiConverterOptionTypeInsertData: FfiConverterRustBuffer {
2157321728
}
2157421729
}
2157521730

21731+
fileprivate struct FfiConverterOptionTypeMatrixEntity: FfiConverterRustBuffer {
21732+
typealias SwiftType = MatrixEntity?
21733+
21734+
public static func write(_ value: SwiftType, into buf: inout [UInt8]) {
21735+
guard let value = value else {
21736+
writeInt(&buf, Int8(0))
21737+
return
21738+
}
21739+
writeInt(&buf, Int8(1))
21740+
FfiConverterTypeMatrixEntity.write(value, into: &buf)
21741+
}
21742+
21743+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType {
21744+
switch try readInt(&buf) as Int8 {
21745+
case 0: return nil
21746+
case 1: return try FfiConverterTypeMatrixEntity.read(from: &buf)
21747+
default: throw UniffiInternalError.unexpectedOptionalTag
21748+
}
21749+
}
21750+
}
21751+
2157621752
fileprivate struct FfiConverterOptionTypeNotificationItem: FfiConverterRustBuffer {
2157721753
typealias SwiftType = NotificationItem?
2157821754

@@ -22987,6 +23163,17 @@ public func makeWidgetDriver(settings: WidgetSettings) throws -> WidgetDriverAn
2298723163
}
2298823164
)
2298923165
}
23166+
/**
23167+
* Generates a `matrix.to` permalink from to the given userID.
23168+
*/
23169+
public func matrixToUserPermalink(userId: String) throws -> String {
23170+
return try FfiConverterString.lift(
23171+
try rustCallWithError(FfiConverterTypeClientError.lift) {
23172+
uniffi_matrix_sdk_ffi_fn_func_matrix_to_user_permalink(
23173+
FfiConverterString.lower(userId),$0)
23174+
}
23175+
)
23176+
}
2299023177
public func mediaSourceFromUrl(url: String) -> MediaSource {
2299123178
return try! FfiConverterTypeMediaSource.lift(
2299223179
try! rustCall() {
@@ -23058,6 +23245,18 @@ public func newVirtualElementCallWidget(props: VirtualElementCallWidgetOptions)
2305823245
}
2305923246
)
2306023247
}
23248+
/**
23249+
* Parse a matrix entity from a given URI, be it either
23250+
* a `matrix.to` link or a `matrix:` URI
23251+
*/
23252+
public func parseMatrixEntityFrom(uri: String) -> MatrixEntity? {
23253+
return try! FfiConverterOptionTypeMatrixEntity.lift(
23254+
try! rustCall() {
23255+
uniffi_matrix_sdk_ffi_fn_func_parse_matrix_entity_from(
23256+
FfiConverterString.lower(uri),$0)
23257+
}
23258+
)
23259+
}
2306123260
public func sdkGitSha() -> String {
2306223261
return try! FfiConverterString.lift(
2306323262
try! rustCall() {
@@ -23128,6 +23327,9 @@ private var initializationResult: InitializationResult {
2312823327
if (uniffi_matrix_sdk_ffi_checksum_func_make_widget_driver() != 11382) {
2312923328
return InitializationResult.apiChecksumMismatch
2313023329
}
23330+
if (uniffi_matrix_sdk_ffi_checksum_func_matrix_to_user_permalink() != 56419) {
23331+
return InitializationResult.apiChecksumMismatch
23332+
}
2313123333
if (uniffi_matrix_sdk_ffi_checksum_func_media_source_from_url() != 33587) {
2313223334
return InitializationResult.apiChecksumMismatch
2313323335
}
@@ -23149,6 +23351,9 @@ private var initializationResult: InitializationResult {
2314923351
if (uniffi_matrix_sdk_ffi_checksum_func_new_virtual_element_call_widget() != 39901) {
2315023352
return InitializationResult.apiChecksumMismatch
2315123353
}
23354+
if (uniffi_matrix_sdk_ffi_checksum_func_parse_matrix_entity_from() != 20064) {
23355+
return InitializationResult.apiChecksumMismatch
23356+
}
2315223357
if (uniffi_matrix_sdk_ffi_checksum_func_sdk_git_sha() != 4038) {
2315323358
return InitializationResult.apiChecksumMismatch
2315423359
}

0 commit comments

Comments
 (0)