Skip to content

Commit 482c8c0

Browse files
committed
Bump to v1.1.13 (matrix-rust-sdk 3b685e01b50123e8486ef65631ca96491eb829fa)
1 parent 8c23071 commit 482c8c0

File tree

2 files changed

+103
-10
lines changed

2 files changed

+103
-10
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 = "e54ed26faebbf3a7cd3731e109c6306a74d7b46ab4e2b5af31f6eaee2863980a"
7-
let version = "v1.1.12"
6+
let checksum = "a5b40d7e1e59ad84ac007b9e95a4c576c9599a77e76823543acef17d55e8588a"
7+
let version = "v1.1.13"
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: 101 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ public func FfiConverterTypeAuthenticationService_lower(_ value: AuthenticationS
593593

594594
public protocol ClientProtocol {
595595
func accountData(eventType: String) throws -> String?
596-
func accountUrl() -> String?
596+
func accountUrl(action: AccountManagementAction?) throws -> String?
597597
func avatarUrl() throws -> String?
598598
func cachedAvatarUrl() throws -> String?
599599
func createRoom(request: CreateRoomParameters) throws -> String
@@ -657,12 +657,12 @@ public class Client: ClientProtocol {
657657
)
658658
}
659659

660-
public func accountUrl() -> String? {
661-
return try! FfiConverterOptionString.lift(
662-
try!
663-
rustCall() {
664-
665-
uniffi_matrix_sdk_ffi_fn_method_client_account_url(self.pointer, $0
660+
public func accountUrl(action: AccountManagementAction?) throws -> String? {
661+
return try FfiConverterOptionString.lift(
662+
try
663+
rustCallWithError(FfiConverterTypeClientError.lift) {
664+
uniffi_matrix_sdk_ffi_fn_method_client_account_url(self.pointer,
665+
FfiConverterOptionTypeAccountManagementAction.lower(action),$0
666666
)
667667
}
668668
)
@@ -8827,6 +8827,78 @@ public func FfiConverterTypeWidgetSettings_lower(_ value: WidgetSettings) -> Rus
88278827
return FfiConverterTypeWidgetSettings.lower(value)
88288828
}
88298829

8830+
// Note that we don't yet support `indirect` for enums.
8831+
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
8832+
public enum AccountManagementAction {
8833+
8834+
case profile
8835+
case sessionsList
8836+
case sessionView(deviceId: String)
8837+
case sessionEnd(deviceId: String)
8838+
}
8839+
8840+
public struct FfiConverterTypeAccountManagementAction: FfiConverterRustBuffer {
8841+
typealias SwiftType = AccountManagementAction
8842+
8843+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AccountManagementAction {
8844+
let variant: Int32 = try readInt(&buf)
8845+
switch variant {
8846+
8847+
case 1: return .profile
8848+
8849+
case 2: return .sessionsList
8850+
8851+
case 3: return .sessionView(
8852+
deviceId: try FfiConverterString.read(from: &buf)
8853+
)
8854+
8855+
case 4: return .sessionEnd(
8856+
deviceId: try FfiConverterString.read(from: &buf)
8857+
)
8858+
8859+
default: throw UniffiInternalError.unexpectedEnumCase
8860+
}
8861+
}
8862+
8863+
public static func write(_ value: AccountManagementAction, into buf: inout [UInt8]) {
8864+
switch value {
8865+
8866+
8867+
case .profile:
8868+
writeInt(&buf, Int32(1))
8869+
8870+
8871+
case .sessionsList:
8872+
writeInt(&buf, Int32(2))
8873+
8874+
8875+
case let .sessionView(deviceId):
8876+
writeInt(&buf, Int32(3))
8877+
FfiConverterString.write(deviceId, into: &buf)
8878+
8879+
8880+
case let .sessionEnd(deviceId):
8881+
writeInt(&buf, Int32(4))
8882+
FfiConverterString.write(deviceId, into: &buf)
8883+
8884+
}
8885+
}
8886+
}
8887+
8888+
8889+
public func FfiConverterTypeAccountManagementAction_lift(_ buf: RustBuffer) throws -> AccountManagementAction {
8890+
return try FfiConverterTypeAccountManagementAction.lift(buf)
8891+
}
8892+
8893+
public func FfiConverterTypeAccountManagementAction_lower(_ value: AccountManagementAction) -> RustBuffer {
8894+
return FfiConverterTypeAccountManagementAction.lower(value)
8895+
}
8896+
8897+
8898+
extension AccountManagementAction: Equatable, Hashable {}
8899+
8900+
8901+
88308902
// Note that we don't yet support `indirect` for enums.
88318903
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
88328904
public enum AssetType {
@@ -14928,6 +15000,27 @@ fileprivate struct FfiConverterOptionTypeVideoInfo: FfiConverterRustBuffer {
1492815000
}
1492915001
}
1493015002

15003+
fileprivate struct FfiConverterOptionTypeAccountManagementAction: FfiConverterRustBuffer {
15004+
typealias SwiftType = AccountManagementAction?
15005+
15006+
public static func write(_ value: SwiftType, into buf: inout [UInt8]) {
15007+
guard let value = value else {
15008+
writeInt(&buf, Int8(0))
15009+
return
15010+
}
15011+
writeInt(&buf, Int8(1))
15012+
FfiConverterTypeAccountManagementAction.write(value, into: &buf)
15013+
}
15014+
15015+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType {
15016+
switch try readInt(&buf) as Int8 {
15017+
case 0: return nil
15018+
case 1: return try FfiConverterTypeAccountManagementAction.read(from: &buf)
15019+
default: throw UniffiInternalError.unexpectedOptionalTag
15020+
}
15021+
}
15022+
}
15023+
1493115024
fileprivate struct FfiConverterOptionTypeAssetType: FfiConverterRustBuffer {
1493215025
typealias SwiftType = AssetType?
1493315026

@@ -17274,7 +17367,7 @@ private var initializationResult: InitializationResult {
1727417367
if (uniffi_matrix_sdk_ffi_checksum_method_client_account_data() != 37263) {
1727517368
return InitializationResult.apiChecksumMismatch
1727617369
}
17277-
if (uniffi_matrix_sdk_ffi_checksum_method_client_account_url() != 29423) {
17370+
if (uniffi_matrix_sdk_ffi_checksum_method_client_account_url() != 57664) {
1727817371
return InitializationResult.apiChecksumMismatch
1727917372
}
1728017373
if (uniffi_matrix_sdk_ffi_checksum_method_client_avatar_url() != 13474) {

0 commit comments

Comments
 (0)