@@ -769,6 +769,21 @@ public protocol ClientProtocol : AnyObject {
769
769
770
770
func searchUsers(searchTerm: String, limit: UInt64) async throws -> SearchUsersResults
771
771
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
+
772
787
func session() throws -> Session
773
788
774
789
/**
@@ -1623,6 +1638,26 @@ open func searchUsers(searchTerm: String, limit: UInt64)async throws -> SearchU
1623
1638
)
1624
1639
}
1625
1640
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
+
1626
1661
open func session()throws -> Session {
1627
1662
return try FfiConverterTypeSession.lift(try rustCallWithError(FfiConverterTypeClientError.lift) {
1628
1663
uniffi_matrix_sdk_ffi_fn_method_client_session(self.uniffiClonePointer(),$0
@@ -11331,12 +11366,14 @@ public func FfiConverterTypeElementCallWellKnown_lower(_ value: ElementCallWellK
11331
11366
* Element specific well-known settings
11332
11367
*/
11333
11368
public struct ElementWellKnown {
11334
- public var call: ElementCallWellKnown
11369
+ public var call: ElementCallWellKnown?
11370
+ public var registrationHelperUrl: String?
11335
11371
11336
11372
// Default memberwise initializers are never public by default, so we
11337
11373
// declare one manually.
11338
- public init(call: ElementCallWellKnown) {
11374
+ public init(call: ElementCallWellKnown?, registrationHelperUrl: String? ) {
11339
11375
self.call = call
11376
+ self.registrationHelperUrl = registrationHelperUrl
11340
11377
}
11341
11378
}
11342
11379
@@ -11347,11 +11384,15 @@ extension ElementWellKnown: Equatable, Hashable {
11347
11384
if lhs.call != rhs.call {
11348
11385
return false
11349
11386
}
11387
+ if lhs.registrationHelperUrl != rhs.registrationHelperUrl {
11388
+ return false
11389
+ }
11350
11390
return true
11351
11391
}
11352
11392
11353
11393
public func hash(into hasher: inout Hasher) {
11354
11394
hasher.combine(call)
11395
+ hasher.combine(registrationHelperUrl)
11355
11396
}
11356
11397
}
11357
11398
@@ -11360,12 +11401,14 @@ public struct FfiConverterTypeElementWellKnown: FfiConverterRustBuffer {
11360
11401
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ElementWellKnown {
11361
11402
return
11362
11403
try ElementWellKnown(
11363
- call: FfiConverterTypeElementCallWellKnown.read(from: &buf)
11404
+ call: FfiConverterOptionTypeElementCallWellKnown.read(from: &buf),
11405
+ registrationHelperUrl: FfiConverterOptionString.read(from: &buf)
11364
11406
)
11365
11407
}
11366
11408
11367
11409
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)
11369
11412
}
11370
11413
}
11371
11414
@@ -25360,6 +25403,27 @@ fileprivate struct FfiConverterOptionTypeComposerDraft: FfiConverterRustBuffer {
25360
25403
}
25361
25404
}
25362
25405
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
+
25363
25427
fileprivate struct FfiConverterOptionTypeFileInfo: FfiConverterRustBuffer {
25364
25428
typealias SwiftType = FileInfo?
25365
25429
@@ -27271,6 +27335,9 @@ private var initializationResult: InitializationResult = {
27271
27335
if (uniffi_matrix_sdk_ffi_checksum_method_client_search_users() != 42927) {
27272
27336
return InitializationResult.apiChecksumMismatch
27273
27337
}
27338
+ if (uniffi_matrix_sdk_ffi_checksum_method_client_server() != 63276) {
27339
+ return InitializationResult.apiChecksumMismatch
27340
+ }
27274
27341
if (uniffi_matrix_sdk_ffi_checksum_method_client_session() != 8085) {
27275
27342
return InitializationResult.apiChecksumMismatch
27276
27343
}
0 commit comments