Skip to content

Commit 7e9a927

Browse files
committed
Bump to version v1.0.49 (matrix-rust-sdk/main a9ed622)
1 parent 08f243c commit 7e9a927

File tree

2 files changed

+73
-6
lines changed

2 files changed

+73
-6
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 = "e497e5f4d9978bc629ff467bbbf0c9e0095997fce753bfd5e7c870c2ca20f189"
5-
let version = "v1.0.48"
4+
let checksum = "c12456b2f7cb0b39482e0b99cfe4b48def48d5171f3fa85deb4c02f7fba7b057"
5+
let version = "v1.0.49"
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: 71 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,21 @@ public protocol ClientProtocol : AnyObject {
769769

770770
func searchUsers(searchTerm: String, limit: UInt64) async throws -> SearchUsersResults
771771

772+
/**
773+
* The URL of the server.
774+
*
775+
* Not to be confused with the `Self::homeserver`. `server` is usually
776+
* the server part in a user ID, e.g. with `@mnt_io:matrix.org`, here
777+
* `matrix.org` is the server, whilst `matrix-client.matrix.org` is the
778+
* homeserver (at the time of writing — 2024-08-28).
779+
*
780+
* This value is optional depending on how the `Client` has been built.
781+
* If it's been built from a homeserver URL directly, we don't know the
782+
* server. However, if the `Client` has been built from a server URL or
783+
* name, then the homeserver has been discovered, and we know both.
784+
*/
785+
func server() -> String?
786+
772787
func session() throws -> Session
773788

774789
/**
@@ -1623,6 +1638,26 @@ open func searchUsers(searchTerm: String, limit: UInt64)async throws -> SearchU
16231638
)
16241639
}
16251640

1641+
/**
1642+
* The URL of the server.
1643+
*
1644+
* Not to be confused with the `Self::homeserver`. `server` is usually
1645+
* the server part in a user ID, e.g. with `@mnt_io:matrix.org`, here
1646+
* `matrix.org` is the server, whilst `matrix-client.matrix.org` is the
1647+
* homeserver (at the time of writing — 2024-08-28).
1648+
*
1649+
* This value is optional depending on how the `Client` has been built.
1650+
* If it's been built from a homeserver URL directly, we don't know the
1651+
* server. However, if the `Client` has been built from a server URL or
1652+
* name, then the homeserver has been discovered, and we know both.
1653+
*/
1654+
open func server() -> String? {
1655+
return try! FfiConverterOptionString.lift(try! rustCall() {
1656+
uniffi_matrix_sdk_ffi_fn_method_client_server(self.uniffiClonePointer(),$0
1657+
)
1658+
})
1659+
}
1660+
16261661
open func session()throws -> Session {
16271662
return try FfiConverterTypeSession.lift(try rustCallWithError(FfiConverterTypeClientError.lift) {
16281663
uniffi_matrix_sdk_ffi_fn_method_client_session(self.uniffiClonePointer(),$0
@@ -11331,12 +11366,14 @@ public func FfiConverterTypeElementCallWellKnown_lower(_ value: ElementCallWellK
1133111366
* Element specific well-known settings
1133211367
*/
1133311368
public struct ElementWellKnown {
11334-
public var call: ElementCallWellKnown
11369+
public var call: ElementCallWellKnown?
11370+
public var registrationHelperUrl: String?
1133511371

1133611372
// Default memberwise initializers are never public by default, so we
1133711373
// declare one manually.
11338-
public init(call: ElementCallWellKnown) {
11374+
public init(call: ElementCallWellKnown?, registrationHelperUrl: String?) {
1133911375
self.call = call
11376+
self.registrationHelperUrl = registrationHelperUrl
1134011377
}
1134111378
}
1134211379

@@ -11347,11 +11384,15 @@ extension ElementWellKnown: Equatable, Hashable {
1134711384
if lhs.call != rhs.call {
1134811385
return false
1134911386
}
11387+
if lhs.registrationHelperUrl != rhs.registrationHelperUrl {
11388+
return false
11389+
}
1135011390
return true
1135111391
}
1135211392

1135311393
public func hash(into hasher: inout Hasher) {
1135411394
hasher.combine(call)
11395+
hasher.combine(registrationHelperUrl)
1135511396
}
1135611397
}
1135711398

@@ -11360,12 +11401,14 @@ public struct FfiConverterTypeElementWellKnown: FfiConverterRustBuffer {
1136011401
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ElementWellKnown {
1136111402
return
1136211403
try ElementWellKnown(
11363-
call: FfiConverterTypeElementCallWellKnown.read(from: &buf)
11404+
call: FfiConverterOptionTypeElementCallWellKnown.read(from: &buf),
11405+
registrationHelperUrl: FfiConverterOptionString.read(from: &buf)
1136411406
)
1136511407
}
1136611408

1136711409
public static func write(_ value: ElementWellKnown, into buf: inout [UInt8]) {
11368-
FfiConverterTypeElementCallWellKnown.write(value.call, into: &buf)
11410+
FfiConverterOptionTypeElementCallWellKnown.write(value.call, into: &buf)
11411+
FfiConverterOptionString.write(value.registrationHelperUrl, into: &buf)
1136911412
}
1137011413
}
1137111414

@@ -25360,6 +25403,27 @@ fileprivate struct FfiConverterOptionTypeComposerDraft: FfiConverterRustBuffer {
2536025403
}
2536125404
}
2536225405

25406+
fileprivate struct FfiConverterOptionTypeElementCallWellKnown: FfiConverterRustBuffer {
25407+
typealias SwiftType = ElementCallWellKnown?
25408+
25409+
public static func write(_ value: SwiftType, into buf: inout [UInt8]) {
25410+
guard let value = value else {
25411+
writeInt(&buf, Int8(0))
25412+
return
25413+
}
25414+
writeInt(&buf, Int8(1))
25415+
FfiConverterTypeElementCallWellKnown.write(value, into: &buf)
25416+
}
25417+
25418+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType {
25419+
switch try readInt(&buf) as Int8 {
25420+
case 0: return nil
25421+
case 1: return try FfiConverterTypeElementCallWellKnown.read(from: &buf)
25422+
default: throw UniffiInternalError.unexpectedOptionalTag
25423+
}
25424+
}
25425+
}
25426+
2536325427
fileprivate struct FfiConverterOptionTypeFileInfo: FfiConverterRustBuffer {
2536425428
typealias SwiftType = FileInfo?
2536525429

@@ -27271,6 +27335,9 @@ private var initializationResult: InitializationResult = {
2727127335
if (uniffi_matrix_sdk_ffi_checksum_method_client_search_users() != 42927) {
2727227336
return InitializationResult.apiChecksumMismatch
2727327337
}
27338+
if (uniffi_matrix_sdk_ffi_checksum_method_client_server() != 63276) {
27339+
return InitializationResult.apiChecksumMismatch
27340+
}
2727427341
if (uniffi_matrix_sdk_ffi_checksum_method_client_session() != 8085) {
2727527342
return InitializationResult.apiChecksumMismatch
2727627343
}

0 commit comments

Comments
 (0)