@@ -11024,6 +11024,11 @@ public protocol SpaceRoomListProtocol : AnyObject {
1102411024 */
1102511025 func rooms() -> [SpaceRoom]
1102611026
11027+ /**
11028+ * Returns the space of the room list if known.
11029+ */
11030+ func space() -> SpaceRoom?
11031+
1102711032 /**
1102811033 * Subscribe to pagination updates.
1102911034 */
@@ -11034,6 +11039,11 @@ public protocol SpaceRoomListProtocol : AnyObject {
1103411039 */
1103511040 func subscribeToRoomUpdate(listener: SpaceRoomListEntriesListener) -> TaskHandle
1103611041
11042+ /**
11043+ * Subscribe to space updates.
11044+ */
11045+ func subscribeToSpaceUpdates(listener: SpaceRoomListSpaceListener) -> TaskHandle
11046+
1103711047}
1103811048
1103911049/**
@@ -11127,6 +11137,16 @@ open func rooms() -> [SpaceRoom] {
1112711137 uniffi_matrix_sdk_ffi_fn_method_spaceroomlist_rooms(self.uniffiClonePointer(),$0
1112811138 )
1112911139})
11140+ }
11141+
11142+ /**
11143+ * Returns the space of the room list if known.
11144+ */
11145+ open func space() -> SpaceRoom? {
11146+ return try! FfiConverterOptionTypeSpaceRoom.lift(try! rustCall() {
11147+ uniffi_matrix_sdk_ffi_fn_method_spaceroomlist_space(self.uniffiClonePointer(),$0
11148+ )
11149+ })
1113011150}
1113111151
1113211152 /**
@@ -11151,6 +11171,17 @@ open func subscribeToRoomUpdate(listener: SpaceRoomListEntriesListener) -> TaskH
1115111171})
1115211172}
1115311173
11174+ /**
11175+ * Subscribe to space updates.
11176+ */
11177+ open func subscribeToSpaceUpdates(listener: SpaceRoomListSpaceListener) -> TaskHandle {
11178+ return try! FfiConverterTypeTaskHandle.lift(try! rustCall() {
11179+ uniffi_matrix_sdk_ffi_fn_method_spaceroomlist_subscribe_to_space_updates(self.uniffiClonePointer(),
11180+ FfiConverterCallbackInterfaceSpaceRoomListSpaceListener.lower(listener),$0
11181+ )
11182+ })
11183+ }
11184+
1115411185
1115511186}
1115611187
@@ -34846,6 +34877,87 @@ extension FfiConverterCallbackInterfaceSpaceRoomListPaginationStateListener : Ff
3484634877
3484734878
3484834879
34880+ public protocol SpaceRoomListSpaceListener : AnyObject {
34881+
34882+ func onUpdate(space: SpaceRoom?)
34883+
34884+ }
34885+
34886+
34887+
34888+ // Put the implementation in a struct so we don't pollute the top-level namespace
34889+ fileprivate struct UniffiCallbackInterfaceSpaceRoomListSpaceListener {
34890+
34891+ // Create the VTable using a series of closures.
34892+ // Swift automatically converts these into C callback functions.
34893+ static var vtable: UniffiVTableCallbackInterfaceSpaceRoomListSpaceListener = UniffiVTableCallbackInterfaceSpaceRoomListSpaceListener(
34894+ onUpdate: { (
34895+ uniffiHandle: UInt64,
34896+ space: RustBuffer,
34897+ uniffiOutReturn: UnsafeMutableRawPointer,
34898+ uniffiCallStatus: UnsafeMutablePointer<RustCallStatus>
34899+ ) in
34900+ let makeCall = {
34901+ () throws -> () in
34902+ guard let uniffiObj = try? FfiConverterCallbackInterfaceSpaceRoomListSpaceListener.handleMap.get(handle: uniffiHandle) else {
34903+ throw UniffiInternalError.unexpectedStaleHandle
34904+ }
34905+ return uniffiObj.onUpdate(
34906+ space: try FfiConverterOptionTypeSpaceRoom.lift(space)
34907+ )
34908+ }
34909+
34910+
34911+ let writeReturn = { () }
34912+ uniffiTraitInterfaceCall(
34913+ callStatus: uniffiCallStatus,
34914+ makeCall: makeCall,
34915+ writeReturn: writeReturn
34916+ )
34917+ },
34918+ uniffiFree: { (uniffiHandle: UInt64) -> () in
34919+ let result = try? FfiConverterCallbackInterfaceSpaceRoomListSpaceListener.handleMap.remove(handle: uniffiHandle)
34920+ if result == nil {
34921+ print("Uniffi callback interface SpaceRoomListSpaceListener: handle missing in uniffiFree")
34922+ }
34923+ }
34924+ )
34925+ }
34926+
34927+ private func uniffiCallbackInitSpaceRoomListSpaceListener() {
34928+ uniffi_matrix_sdk_ffi_fn_init_callback_vtable_spaceroomlistspacelistener(&UniffiCallbackInterfaceSpaceRoomListSpaceListener.vtable)
34929+ }
34930+
34931+ // FfiConverter protocol for callback interfaces
34932+ fileprivate struct FfiConverterCallbackInterfaceSpaceRoomListSpaceListener {
34933+ fileprivate static var handleMap = UniffiHandleMap<SpaceRoomListSpaceListener>()
34934+ }
34935+
34936+ extension FfiConverterCallbackInterfaceSpaceRoomListSpaceListener : FfiConverter {
34937+ typealias SwiftType = SpaceRoomListSpaceListener
34938+ typealias FfiType = UInt64
34939+
34940+ public static func lift(_ handle: UInt64) throws -> SwiftType {
34941+ try handleMap.get(handle: handle)
34942+ }
34943+
34944+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType {
34945+ let handle: UInt64 = try readInt(&buf)
34946+ return try lift(handle)
34947+ }
34948+
34949+ public static func lower(_ v: SwiftType) -> UInt64 {
34950+ return handleMap.insert(obj: v)
34951+ }
34952+
34953+ public static func write(_ v: SwiftType, into buf: inout [UInt8]) {
34954+ writeInt(&buf, lower(v))
34955+ }
34956+ }
34957+
34958+
34959+
34960+
3484934961public protocol SpaceServiceJoinedSpacesListener : AnyObject {
3485034962
3485134963 func onUpdate(roomUpdates: [SpaceListUpdate])
@@ -36187,6 +36299,27 @@ fileprivate struct FfiConverterOptionTypeRoomMemberWithSenderInfo: FfiConverterR
3618736299 }
3618836300}
3618936301
36302+ fileprivate struct FfiConverterOptionTypeSpaceRoom: FfiConverterRustBuffer {
36303+ typealias SwiftType = SpaceRoom?
36304+
36305+ public static func write(_ value: SwiftType, into buf: inout [UInt8]) {
36306+ guard let value = value else {
36307+ writeInt(&buf, Int8(0))
36308+ return
36309+ }
36310+ writeInt(&buf, Int8(1))
36311+ FfiConverterTypeSpaceRoom.write(value, into: &buf)
36312+ }
36313+
36314+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType {
36315+ switch try readInt(&buf) as Int8 {
36316+ case 0: return nil
36317+ case 1: return try FfiConverterTypeSpaceRoom.read(from: &buf)
36318+ default: throw UniffiInternalError.unexpectedOptionalTag
36319+ }
36320+ }
36321+ }
36322+
3619036323fileprivate struct FfiConverterOptionTypeSuccessorRoom: FfiConverterRustBuffer {
3619136324 typealias SwiftType = SuccessorRoom?
3619236325
@@ -39523,12 +39656,18 @@ private var initializationResult: InitializationResult = {
3952339656 if (uniffi_matrix_sdk_ffi_checksum_method_spaceroomlist_rooms() != 24664) {
3952439657 return InitializationResult.apiChecksumMismatch
3952539658 }
39659+ if (uniffi_matrix_sdk_ffi_checksum_method_spaceroomlist_space() != 25368) {
39660+ return InitializationResult.apiChecksumMismatch
39661+ }
3952639662 if (uniffi_matrix_sdk_ffi_checksum_method_spaceroomlist_subscribe_to_pagination_state_updates() != 16775) {
3952739663 return InitializationResult.apiChecksumMismatch
3952839664 }
3952939665 if (uniffi_matrix_sdk_ffi_checksum_method_spaceroomlist_subscribe_to_room_update() != 55793) {
3953039666 return InitializationResult.apiChecksumMismatch
3953139667 }
39668+ if (uniffi_matrix_sdk_ffi_checksum_method_spaceroomlist_subscribe_to_space_updates() != 26327) {
39669+ return InitializationResult.apiChecksumMismatch
39670+ }
3953239671 if (uniffi_matrix_sdk_ffi_checksum_method_spaceservice_joined_spaces() != 54285) {
3953339672 return InitializationResult.apiChecksumMismatch
3953439673 }
@@ -39868,6 +40007,9 @@ private var initializationResult: InitializationResult = {
3986840007 if (uniffi_matrix_sdk_ffi_checksum_method_spaceroomlistpaginationstatelistener_on_update() != 11960) {
3986940008 return InitializationResult.apiChecksumMismatch
3987040009 }
40010+ if (uniffi_matrix_sdk_ffi_checksum_method_spaceroomlistspacelistener_on_update() != 39714) {
40011+ return InitializationResult.apiChecksumMismatch
40012+ }
3987140013 if (uniffi_matrix_sdk_ffi_checksum_method_spaceservicejoinedspaceslistener_on_update() != 19262) {
3987240014 return InitializationResult.apiChecksumMismatch
3987340015 }
@@ -39918,6 +40060,7 @@ private var initializationResult: InitializationResult = {
3991840060 uniffiCallbackInitSessionVerificationControllerDelegate()
3991940061 uniffiCallbackInitSpaceRoomListEntriesListener()
3992040062 uniffiCallbackInitSpaceRoomListPaginationStateListener()
40063+ uniffiCallbackInitSpaceRoomListSpaceListener()
3992140064 uniffiCallbackInitSpaceServiceJoinedSpacesListener()
3992240065 uniffiCallbackInitSyncServiceStateObserver()
3992340066 uniffiCallbackInitTimelineListener()
0 commit comments