Skip to content

Commit c0101eb

Browse files
committed
Bump to v1.1.40 (matrix-rust-sdk/main 11074d8f4dabd9294e49e6ad8562a970eca1df46)
1 parent 8a5813a commit c0101eb

File tree

2 files changed

+86
-8
lines changed

2 files changed

+86
-8
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 = "2e6dd288006502cdf39c96896c090e6b118bd15449b2e701b7fd7b8e4ebca713"
7-
let version = "v1.1.39"
6+
let checksum = "d30f2af4731492385bc4ceb3e135ab09eb5121173e1857bb922fd390ab986c84"
7+
let version = "v1.1.40"
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: 84 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -536,12 +536,13 @@ public class AuthenticationService:
536536
/**
537537
* Creates a new service to authenticate a user with.
538538
*/
539-
public convenience init(basePath: String, passphrase: String?, userAgent: String?, oidcConfiguration: OidcConfiguration?, customSlidingSyncProxy: String?, sessionDelegate: ClientSessionDelegate?, crossProcessRefreshLockId: String?) {
539+
public convenience init(basePath: String, passphrase: String?, userAgent: String?, additionalRootCertificates: [Data], oidcConfiguration: OidcConfiguration?, customSlidingSyncProxy: String?, sessionDelegate: ClientSessionDelegate?, crossProcessRefreshLockId: String?) {
540540
self.init(unsafeFromRawPointer: try! rustCall() {
541541
uniffi_matrix_sdk_ffi_fn_constructor_authenticationservice_new(
542542
FfiConverterString.lower(basePath),
543543
FfiConverterOptionString.lower(passphrase),
544544
FfiConverterOptionString.lower(userAgent),
545+
FfiConverterSequenceData.lower(additionalRootCertificates),
545546
FfiConverterOptionTypeOidcConfiguration.lower(oidcConfiguration),
546547
FfiConverterOptionString.lower(customSlidingSyncProxy),
547548
FfiConverterOptionCallbackInterfaceClientSessionDelegate.lower(sessionDelegate),
@@ -1229,6 +1230,8 @@ public func FfiConverterTypeClient_lower(_ value: Client) -> UnsafeMutableRawPoi
12291230

12301231
public protocol ClientBuilderProtocol : AnyObject {
12311232

1233+
func addRootCertificates(certificates: [Data]) -> ClientBuilder
1234+
12321235
func basePath(path: String) -> ClientBuilder
12331236

12341237
func build() throws -> Client
@@ -1287,6 +1290,17 @@ public class ClientBuilder:
12871290

12881291

12891292

1293+
public func addRootCertificates(certificates: [Data]) -> ClientBuilder {
1294+
return try! FfiConverterTypeClientBuilder.lift(
1295+
try!
1296+
rustCall() {
1297+
1298+
uniffi_matrix_sdk_ffi_fn_method_clientbuilder_add_root_certificates(self.uniffiClonePointer(),
1299+
FfiConverterSequenceData.lower(certificates),$0
1300+
)
1301+
}
1302+
)
1303+
}
12901304
public func basePath(path: String) -> ClientBuilder {
12911305
return try! FfiConverterTypeClientBuilder.lift(
12921306
try!
@@ -14216,7 +14230,9 @@ public enum OtherState {
1421614230
name: String?
1421714231
)
1421814232
case roomPinnedEvents
14219-
case roomPowerLevels
14233+
case roomPowerLevels(
14234+
users: [String: Int64]
14235+
)
1422014236
case roomServerAcl
1422114237
case roomThirdPartyInvite(
1422214238
displayName: String?
@@ -14269,7 +14285,9 @@ public struct FfiConverterTypeOtherState: FfiConverterRustBuffer {
1426914285

1427014286
case 13: return .roomPinnedEvents
1427114287

14272-
case 14: return .roomPowerLevels
14288+
case 14: return .roomPowerLevels(
14289+
users: try FfiConverterDictionaryStringInt64.read(from: &buf)
14290+
)
1427314291

1427414292
case 15: return .roomServerAcl
1427514293

@@ -14353,9 +14371,10 @@ public struct FfiConverterTypeOtherState: FfiConverterRustBuffer {
1435314371
writeInt(&buf, Int32(13))
1435414372

1435514373

14356-
case .roomPowerLevels:
14374+
case let .roomPowerLevels(users):
1435714375
writeInt(&buf, Int32(14))
14358-
14376+
FfiConverterDictionaryStringInt64.write(users, into: &buf)
14377+
1435914378

1436014379
case .roomServerAcl:
1436114380
writeInt(&buf, Int32(15))
@@ -20429,6 +20448,28 @@ fileprivate struct FfiConverterSequenceString: FfiConverterRustBuffer {
2042920448
}
2043020449
}
2043120450

20451+
fileprivate struct FfiConverterSequenceData: FfiConverterRustBuffer {
20452+
typealias SwiftType = [Data]
20453+
20454+
public static func write(_ value: [Data], into buf: inout [UInt8]) {
20455+
let len = Int32(value.count)
20456+
writeInt(&buf, len)
20457+
for item in value {
20458+
FfiConverterData.write(item, into: &buf)
20459+
}
20460+
}
20461+
20462+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [Data] {
20463+
let len: Int32 = try readInt(&buf)
20464+
var seq = [Data]()
20465+
seq.reserveCapacity(Int(len))
20466+
for _ in 0 ..< len {
20467+
seq.append(try FfiConverterData.read(from: &buf))
20468+
}
20469+
return seq
20470+
}
20471+
}
20472+
2043220473
fileprivate struct FfiConverterSequenceTypeRoom: FfiConverterRustBuffer {
2043320474
typealias SwiftType = [Room]
2043420475

@@ -20804,6 +20845,29 @@ fileprivate struct FfiConverterDictionaryStringInt32: FfiConverterRustBuffer {
2080420845
}
2080520846
}
2080620847

20848+
fileprivate struct FfiConverterDictionaryStringInt64: FfiConverterRustBuffer {
20849+
public static func write(_ value: [String: Int64], into buf: inout [UInt8]) {
20850+
let len = Int32(value.count)
20851+
writeInt(&buf, len)
20852+
for (key, value) in value {
20853+
FfiConverterString.write(key, into: &buf)
20854+
FfiConverterInt64.write(value, into: &buf)
20855+
}
20856+
}
20857+
20858+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [String: Int64] {
20859+
let len: Int32 = try readInt(&buf)
20860+
var dict = [String: Int64]()
20861+
dict.reserveCapacity(Int(len))
20862+
for _ in 0..<len {
20863+
let key = try FfiConverterString.read(from: &buf)
20864+
let value = try FfiConverterInt64.read(from: &buf)
20865+
dict[key] = value
20866+
}
20867+
return dict
20868+
}
20869+
}
20870+
2080720871
fileprivate struct FfiConverterDictionaryStringString: FfiConverterRustBuffer {
2080820872
public static func write(_ value: [String: String], into buf: inout [UInt8]) {
2080920873
let len = Int32(value.count)
@@ -21122,6 +21186,14 @@ public func setupTracing(config: TracingConfiguration) {
2112221186
}
2112321187

2112421188

21189+
public func suggestedRoleForPowerLevel(powerLevel: Int64) -> RoomMemberRole {
21190+
return try! FfiConverterTypeRoomMemberRole_lift(
21191+
try! rustCall() {
21192+
uniffi_matrix_sdk_ffi_fn_func_suggested_role_for_power_level(
21193+
FfiConverterInt64.lower(powerLevel),$0)
21194+
}
21195+
)
21196+
}
2112521197

2112621198
private enum InitializationResult {
2112721199
case ok
@@ -21183,6 +21255,9 @@ private var initializationResult: InitializationResult {
2118321255
if (uniffi_matrix_sdk_ffi_checksum_func_setup_tracing() != 35378) {
2118421256
return InitializationResult.apiChecksumMismatch
2118521257
}
21258+
if (uniffi_matrix_sdk_ffi_checksum_func_suggested_role_for_power_level() != 21984) {
21259+
return InitializationResult.apiChecksumMismatch
21260+
}
2118621261
if (uniffi_matrix_sdk_ffi_checksum_method_mediasource_to_json() != 2998) {
2118721262
return InitializationResult.apiChecksumMismatch
2118821263
}
@@ -21309,6 +21384,9 @@ private var initializationResult: InitializationResult {
2130921384
if (uniffi_matrix_sdk_ffi_checksum_method_client_user_id() != 40531) {
2131021385
return InitializationResult.apiChecksumMismatch
2131121386
}
21387+
if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_add_root_certificates() != 57950) {
21388+
return InitializationResult.apiChecksumMismatch
21389+
}
2131221390
if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_base_path() != 40888) {
2131321391
return InitializationResult.apiChecksumMismatch
2131421392
}
@@ -22074,7 +22152,7 @@ private var initializationResult: InitializationResult {
2207422152
if (uniffi_matrix_sdk_ffi_checksum_constructor_mediasource_from_json() != 62542) {
2207522153
return InitializationResult.apiChecksumMismatch
2207622154
}
22077-
if (uniffi_matrix_sdk_ffi_checksum_constructor_authenticationservice_new() != 1456) {
22155+
if (uniffi_matrix_sdk_ffi_checksum_constructor_authenticationservice_new() != 61043) {
2207822156
return InitializationResult.apiChecksumMismatch
2207922157
}
2208022158
if (uniffi_matrix_sdk_ffi_checksum_constructor_clientbuilder_new() != 43131) {

0 commit comments

Comments
 (0)