From 2b916472dd2a8f51ea725ba4a92bd1ab359be1dd Mon Sep 17 00:00:00 2001 From: Valentin Weiss <10179089+WeissDev@users.noreply.github.com> Date: Mon, 29 Dec 2025 16:48:20 +0100 Subject: [PATCH] chore: update matrix-rust-sdk to 0.16.0 --- .../rustcomponents/sdk/matrix_sdk_ffi.kt | 8315 +++++++++-- .../main/java/uniffi/matrix_sdk/matrix_sdk.kt | 299 +- .../uniffi/matrix_sdk_base/matrix_sdk_base.kt | 2 +- .../uniffi/matrix_sdk_ui/matrix_sdk_ui.kt | 43 + cpp/generated/matrix_sdk_ffi.cpp | 7720 ++++++++-- cpp/generated/matrix_sdk_ffi.hpp | 450 +- matrix-rust-sdk.patch | 379 +- src/generated/matrix_sdk.ts | 401 +- src/generated/matrix_sdk_base.ts | 2 +- src/generated/matrix_sdk_ffi-ffi.ts | 415 +- src/generated/matrix_sdk_ffi.ts | 12168 ++++++++++++---- src/generated/matrix_sdk_ui.ts | 52 + swift/matrix_sdk.swift | 521 +- swift/matrix_sdk_base.swift | 2 +- swift/matrix_sdk_ffi.swift | 7769 +++++++--- swift/matrix_sdk_ui.swift | 89 + ubrn.yaml | 2 +- 17 files changed, 30894 insertions(+), 7735 deletions(-) diff --git a/android/src/main/java/org/matrix/rustcomponents/sdk/matrix_sdk_ffi.kt b/android/src/main/java/org/matrix/rustcomponents/sdk/matrix_sdk_ffi.kt index 05d83d7..36405a0 100644 --- a/android/src/main/java/org/matrix/rustcomponents/sdk/matrix_sdk_ffi.kt +++ b/android/src/main/java/org/matrix/rustcomponents/sdk/matrix_sdk_ffi.kt @@ -47,13 +47,15 @@ import uniffi.matrix_sdk.FfiConverterTypeRoomMemberRole import uniffi.matrix_sdk.FfiConverterTypeRoomPaginationStatus import uniffi.matrix_sdk.FfiConverterTypeRoomPowerLevelChanges import uniffi.matrix_sdk.FfiConverterTypeServerVendorInfo -import uniffi.matrix_sdk.FfiConverterTypeVirtualElementCallWidgetOptions +import uniffi.matrix_sdk.FfiConverterTypeVirtualElementCallWidgetConfig +import uniffi.matrix_sdk.FfiConverterTypeVirtualElementCallWidgetProperties import uniffi.matrix_sdk.OAuthAuthorizationData import uniffi.matrix_sdk.RoomMemberRole import uniffi.matrix_sdk.RoomPaginationStatus import uniffi.matrix_sdk.RoomPowerLevelChanges import uniffi.matrix_sdk.ServerVendorInfo -import uniffi.matrix_sdk.VirtualElementCallWidgetOptions +import uniffi.matrix_sdk.VirtualElementCallWidgetConfig +import uniffi.matrix_sdk.VirtualElementCallWidgetProperties import uniffi.matrix_sdk_base.EncryptionState import uniffi.matrix_sdk_base.FfiConverterTypeEncryptionState import uniffi.matrix_sdk_base.FfiConverterTypeMediaRetentionPolicy @@ -72,15 +74,18 @@ import uniffi.matrix_sdk_ui.EventItemOrigin import uniffi.matrix_sdk_ui.FfiConverterTypeEventItemOrigin import uniffi.matrix_sdk_ui.FfiConverterTypeRoomPinnedEventsChange import uniffi.matrix_sdk_ui.FfiConverterTypeSpaceRoomListPaginationState +import uniffi.matrix_sdk_ui.FfiConverterTypeTimelineReadReceiptTracking import uniffi.matrix_sdk_ui.RoomPinnedEventsChange import uniffi.matrix_sdk_ui.SpaceRoomListPaginationState +import uniffi.matrix_sdk_ui.TimelineReadReceiptTracking import uniffi.matrix_sdk.RustBuffer as RustBufferBackupDownloadStrategy import uniffi.matrix_sdk.RustBuffer as RustBufferOAuthAuthorizationData import uniffi.matrix_sdk.RustBuffer as RustBufferRoomMemberRole import uniffi.matrix_sdk.RustBuffer as RustBufferRoomPaginationStatus import uniffi.matrix_sdk.RustBuffer as RustBufferRoomPowerLevelChanges import uniffi.matrix_sdk.RustBuffer as RustBufferServerVendorInfo -import uniffi.matrix_sdk.RustBuffer as RustBufferVirtualElementCallWidgetOptions +import uniffi.matrix_sdk.RustBuffer as RustBufferVirtualElementCallWidgetConfig +import uniffi.matrix_sdk.RustBuffer as RustBufferVirtualElementCallWidgetProperties import uniffi.matrix_sdk_base.RustBuffer as RustBufferEncryptionState import uniffi.matrix_sdk_base.RustBuffer as RustBufferMediaRetentionPolicy import uniffi.matrix_sdk_common.RustBuffer as RustBufferShieldStateCode @@ -91,6 +96,7 @@ import uniffi.matrix_sdk_crypto.RustBuffer as RustBufferUtdCause import uniffi.matrix_sdk_ui.RustBuffer as RustBufferEventItemOrigin import uniffi.matrix_sdk_ui.RustBuffer as RustBufferRoomPinnedEventsChange import uniffi.matrix_sdk_ui.RustBuffer as RustBufferSpaceRoomListPaginationState +import uniffi.matrix_sdk_ui.RustBuffer as RustBufferTimelineReadReceiptTracking // This is a helper for safely working with byte buffers returned from the Rust code. // A rust-owned buffer is represented by its capacity, its current length, and a @@ -723,6 +729,9 @@ internal interface UniffiCallbackInterfaceBackupStateListenerMethod0 : com.sun.j internal interface UniffiCallbackInterfaceBackupSteadyStateListenerMethod0 : com.sun.jna.Callback { fun callback(`uniffiHandle`: Long,`status`: RustBuffer.ByValue,`uniffiOutReturn`: Pointer,uniffiCallStatus: UniffiRustCallStatus,) } +internal interface UniffiCallbackInterfaceCallDeclineListenerMethod0 : com.sun.jna.Callback { + fun callback(`uniffiHandle`: Long,`declinerUserId`: RustBuffer.ByValue,`uniffiOutReturn`: Pointer,uniffiCallStatus: UniffiRustCallStatus,) +} internal interface UniffiCallbackInterfaceClientDelegateMethod0 : com.sun.jna.Callback { fun callback(`uniffiHandle`: Long,`isSoftLogout`: Byte,`uniffiOutReturn`: Pointer,uniffiCallStatus: UniffiRustCallStatus,) } @@ -735,6 +744,15 @@ internal interface UniffiCallbackInterfaceClientSessionDelegateMethod1 : com.sun internal interface UniffiCallbackInterfaceEnableRecoveryProgressListenerMethod0 : com.sun.jna.Callback { fun callback(`uniffiHandle`: Long,`status`: RustBuffer.ByValue,`uniffiOutReturn`: Pointer,uniffiCallStatus: UniffiRustCallStatus,) } +internal interface UniffiCallbackInterfaceGeneratedQrLoginProgressListenerMethod0 : com.sun.jna.Callback { + fun callback(`uniffiHandle`: Long,`state`: RustBuffer.ByValue,`uniffiOutReturn`: Pointer,uniffiCallStatus: UniffiRustCallStatus,) +} +internal interface UniffiCallbackInterfaceGrantGeneratedQrLoginProgressListenerMethod0 : com.sun.jna.Callback { + fun callback(`uniffiHandle`: Long,`state`: RustBuffer.ByValue,`uniffiOutReturn`: Pointer,uniffiCallStatus: UniffiRustCallStatus,) +} +internal interface UniffiCallbackInterfaceGrantQrLoginProgressListenerMethod0 : com.sun.jna.Callback { + fun callback(`uniffiHandle`: Long,`state`: RustBuffer.ByValue,`uniffiOutReturn`: Pointer,uniffiCallStatus: UniffiRustCallStatus,) +} internal interface UniffiCallbackInterfaceIdentityStatusChangeListenerMethod0 : com.sun.jna.Callback { fun callback(`uniffiHandle`: Long,`identityStatusChange`: RustBuffer.ByValue,`uniffiOutReturn`: Pointer,uniffiCallStatus: UniffiRustCallStatus,) } @@ -786,9 +804,15 @@ internal interface UniffiCallbackInterfaceRoomListServiceStateListenerMethod0 : internal interface UniffiCallbackInterfaceRoomListServiceSyncIndicatorListenerMethod0 : com.sun.jna.Callback { fun callback(`uniffiHandle`: Long,`syncIndicator`: RustBuffer.ByValue,`uniffiOutReturn`: Pointer,uniffiCallStatus: UniffiRustCallStatus,) } +internal interface UniffiCallbackInterfaceSendQueueListenerMethod0 : com.sun.jna.Callback { + fun callback(`uniffiHandle`: Long,`update`: RustBuffer.ByValue,`uniffiOutReturn`: Pointer,uniffiCallStatus: UniffiRustCallStatus,) +} internal interface UniffiCallbackInterfaceSendQueueRoomErrorListenerMethod0 : com.sun.jna.Callback { fun callback(`uniffiHandle`: Long,`roomId`: RustBuffer.ByValue,`error`: RustBuffer.ByValue,`uniffiOutReturn`: Pointer,uniffiCallStatus: UniffiRustCallStatus,) } +internal interface UniffiCallbackInterfaceSendQueueRoomUpdateListenerMethod0 : com.sun.jna.Callback { + fun callback(`uniffiHandle`: Long,`roomId`: RustBuffer.ByValue,`update`: RustBuffer.ByValue,`uniffiOutReturn`: Pointer,uniffiCallStatus: UniffiRustCallStatus,) +} internal interface UniffiCallbackInterfaceSessionVerificationControllerDelegateMethod0 : com.sun.jna.Callback { fun callback(`uniffiHandle`: Long,`details`: RustBuffer.ByValue,`uniffiOutReturn`: Pointer,uniffiCallStatus: UniffiRustCallStatus,) } @@ -816,9 +840,15 @@ internal interface UniffiCallbackInterfaceSpaceRoomListEntriesListenerMethod0 : internal interface UniffiCallbackInterfaceSpaceRoomListPaginationStateListenerMethod0 : com.sun.jna.Callback { fun callback(`uniffiHandle`: Long,`paginationState`: RustBufferSpaceRoomListPaginationState.ByValue,`uniffiOutReturn`: Pointer,uniffiCallStatus: UniffiRustCallStatus,) } +internal interface UniffiCallbackInterfaceSpaceRoomListSpaceListenerMethod0 : com.sun.jna.Callback { + fun callback(`uniffiHandle`: Long,`space`: RustBuffer.ByValue,`uniffiOutReturn`: Pointer,uniffiCallStatus: UniffiRustCallStatus,) +} internal interface UniffiCallbackInterfaceSpaceServiceJoinedSpacesListenerMethod0 : com.sun.jna.Callback { fun callback(`uniffiHandle`: Long,`roomUpdates`: RustBuffer.ByValue,`uniffiOutReturn`: Pointer,uniffiCallStatus: UniffiRustCallStatus,) } +internal interface UniffiCallbackInterfaceSyncNotificationListenerMethod0 : com.sun.jna.Callback { + fun callback(`uniffiHandle`: Long,`notification`: RustBuffer.ByValue,`roomId`: RustBuffer.ByValue,`uniffiOutReturn`: Pointer,uniffiCallStatus: UniffiRustCallStatus,) +} internal interface UniffiCallbackInterfaceSyncServiceStateObserverMethod0 : com.sun.jna.Callback { fun callback(`uniffiHandle`: Long,`state`: RustBuffer.ByValue,`uniffiOutReturn`: Pointer,uniffiCallStatus: UniffiRustCallStatus,) } @@ -884,6 +914,22 @@ internal open class UniffiVTableCallbackInterfaceBackupSteadyStateListener( `uniffiFree` = other.`uniffiFree` } +} +@Structure.FieldOrder("call", "uniffiFree") +internal open class UniffiVTableCallbackInterfaceCallDeclineListener( + @JvmField internal var `call`: UniffiCallbackInterfaceCallDeclineListenerMethod0? = null, + @JvmField internal var `uniffiFree`: UniffiCallbackInterfaceFree? = null, +) : Structure() { + class UniffiByValue( + `call`: UniffiCallbackInterfaceCallDeclineListenerMethod0? = null, + `uniffiFree`: UniffiCallbackInterfaceFree? = null, + ): UniffiVTableCallbackInterfaceCallDeclineListener(`call`,`uniffiFree`,), Structure.ByValue + + internal fun uniffiSetValue(other: UniffiVTableCallbackInterfaceCallDeclineListener) { + `call` = other.`call` + `uniffiFree` = other.`uniffiFree` + } + } @Structure.FieldOrder("didReceiveAuthError", "uniffiFree") internal open class UniffiVTableCallbackInterfaceClientDelegate( @@ -935,6 +981,54 @@ internal open class UniffiVTableCallbackInterfaceEnableRecoveryProgressListener( `uniffiFree` = other.`uniffiFree` } +} +@Structure.FieldOrder("onUpdate", "uniffiFree") +internal open class UniffiVTableCallbackInterfaceGeneratedQrLoginProgressListener( + @JvmField internal var `onUpdate`: UniffiCallbackInterfaceGeneratedQrLoginProgressListenerMethod0? = null, + @JvmField internal var `uniffiFree`: UniffiCallbackInterfaceFree? = null, +) : Structure() { + class UniffiByValue( + `onUpdate`: UniffiCallbackInterfaceGeneratedQrLoginProgressListenerMethod0? = null, + `uniffiFree`: UniffiCallbackInterfaceFree? = null, + ): UniffiVTableCallbackInterfaceGeneratedQrLoginProgressListener(`onUpdate`,`uniffiFree`,), Structure.ByValue + + internal fun uniffiSetValue(other: UniffiVTableCallbackInterfaceGeneratedQrLoginProgressListener) { + `onUpdate` = other.`onUpdate` + `uniffiFree` = other.`uniffiFree` + } + +} +@Structure.FieldOrder("onUpdate", "uniffiFree") +internal open class UniffiVTableCallbackInterfaceGrantGeneratedQrLoginProgressListener( + @JvmField internal var `onUpdate`: UniffiCallbackInterfaceGrantGeneratedQrLoginProgressListenerMethod0? = null, + @JvmField internal var `uniffiFree`: UniffiCallbackInterfaceFree? = null, +) : Structure() { + class UniffiByValue( + `onUpdate`: UniffiCallbackInterfaceGrantGeneratedQrLoginProgressListenerMethod0? = null, + `uniffiFree`: UniffiCallbackInterfaceFree? = null, + ): UniffiVTableCallbackInterfaceGrantGeneratedQrLoginProgressListener(`onUpdate`,`uniffiFree`,), Structure.ByValue + + internal fun uniffiSetValue(other: UniffiVTableCallbackInterfaceGrantGeneratedQrLoginProgressListener) { + `onUpdate` = other.`onUpdate` + `uniffiFree` = other.`uniffiFree` + } + +} +@Structure.FieldOrder("onUpdate", "uniffiFree") +internal open class UniffiVTableCallbackInterfaceGrantQrLoginProgressListener( + @JvmField internal var `onUpdate`: UniffiCallbackInterfaceGrantQrLoginProgressListenerMethod0? = null, + @JvmField internal var `uniffiFree`: UniffiCallbackInterfaceFree? = null, +) : Structure() { + class UniffiByValue( + `onUpdate`: UniffiCallbackInterfaceGrantQrLoginProgressListenerMethod0? = null, + `uniffiFree`: UniffiCallbackInterfaceFree? = null, + ): UniffiVTableCallbackInterfaceGrantQrLoginProgressListener(`onUpdate`,`uniffiFree`,), Structure.ByValue + + internal fun uniffiSetValue(other: UniffiVTableCallbackInterfaceGrantQrLoginProgressListener) { + `onUpdate` = other.`onUpdate` + `uniffiFree` = other.`uniffiFree` + } + } @Structure.FieldOrder("call", "uniffiFree") internal open class UniffiVTableCallbackInterfaceIdentityStatusChangeListener( @@ -1207,6 +1301,22 @@ internal open class UniffiVTableCallbackInterfaceRoomListServiceSyncIndicatorLis `uniffiFree` = other.`uniffiFree` } +} +@Structure.FieldOrder("onUpdate", "uniffiFree") +internal open class UniffiVTableCallbackInterfaceSendQueueListener( + @JvmField internal var `onUpdate`: UniffiCallbackInterfaceSendQueueListenerMethod0? = null, + @JvmField internal var `uniffiFree`: UniffiCallbackInterfaceFree? = null, +) : Structure() { + class UniffiByValue( + `onUpdate`: UniffiCallbackInterfaceSendQueueListenerMethod0? = null, + `uniffiFree`: UniffiCallbackInterfaceFree? = null, + ): UniffiVTableCallbackInterfaceSendQueueListener(`onUpdate`,`uniffiFree`,), Structure.ByValue + + internal fun uniffiSetValue(other: UniffiVTableCallbackInterfaceSendQueueListener) { + `onUpdate` = other.`onUpdate` + `uniffiFree` = other.`uniffiFree` + } + } @Structure.FieldOrder("onError", "uniffiFree") internal open class UniffiVTableCallbackInterfaceSendQueueRoomErrorListener( @@ -1223,6 +1333,22 @@ internal open class UniffiVTableCallbackInterfaceSendQueueRoomErrorListener( `uniffiFree` = other.`uniffiFree` } +} +@Structure.FieldOrder("onUpdate", "uniffiFree") +internal open class UniffiVTableCallbackInterfaceSendQueueRoomUpdateListener( + @JvmField internal var `onUpdate`: UniffiCallbackInterfaceSendQueueRoomUpdateListenerMethod0? = null, + @JvmField internal var `uniffiFree`: UniffiCallbackInterfaceFree? = null, +) : Structure() { + class UniffiByValue( + `onUpdate`: UniffiCallbackInterfaceSendQueueRoomUpdateListenerMethod0? = null, + `uniffiFree`: UniffiCallbackInterfaceFree? = null, + ): UniffiVTableCallbackInterfaceSendQueueRoomUpdateListener(`onUpdate`,`uniffiFree`,), Structure.ByValue + + internal fun uniffiSetValue(other: UniffiVTableCallbackInterfaceSendQueueRoomUpdateListener) { + `onUpdate` = other.`onUpdate` + `uniffiFree` = other.`uniffiFree` + } + } @Structure.FieldOrder("didReceiveVerificationRequest", "didAcceptVerificationRequest", "didStartSasVerification", "didReceiveVerificationData", "didFail", "didCancel", "didFinish", "uniffiFree") internal open class UniffiVTableCallbackInterfaceSessionVerificationControllerDelegate( @@ -1289,6 +1415,22 @@ internal open class UniffiVTableCallbackInterfaceSpaceRoomListPaginationStateLis `uniffiFree` = other.`uniffiFree` } +} +@Structure.FieldOrder("onUpdate", "uniffiFree") +internal open class UniffiVTableCallbackInterfaceSpaceRoomListSpaceListener( + @JvmField internal var `onUpdate`: UniffiCallbackInterfaceSpaceRoomListSpaceListenerMethod0? = null, + @JvmField internal var `uniffiFree`: UniffiCallbackInterfaceFree? = null, +) : Structure() { + class UniffiByValue( + `onUpdate`: UniffiCallbackInterfaceSpaceRoomListSpaceListenerMethod0? = null, + `uniffiFree`: UniffiCallbackInterfaceFree? = null, + ): UniffiVTableCallbackInterfaceSpaceRoomListSpaceListener(`onUpdate`,`uniffiFree`,), Structure.ByValue + + internal fun uniffiSetValue(other: UniffiVTableCallbackInterfaceSpaceRoomListSpaceListener) { + `onUpdate` = other.`onUpdate` + `uniffiFree` = other.`uniffiFree` + } + } @Structure.FieldOrder("onUpdate", "uniffiFree") internal open class UniffiVTableCallbackInterfaceSpaceServiceJoinedSpacesListener( @@ -1305,6 +1447,22 @@ internal open class UniffiVTableCallbackInterfaceSpaceServiceJoinedSpacesListene `uniffiFree` = other.`uniffiFree` } +} +@Structure.FieldOrder("onNotification", "uniffiFree") +internal open class UniffiVTableCallbackInterfaceSyncNotificationListener( + @JvmField internal var `onNotification`: UniffiCallbackInterfaceSyncNotificationListenerMethod0? = null, + @JvmField internal var `uniffiFree`: UniffiCallbackInterfaceFree? = null, +) : Structure() { + class UniffiByValue( + `onNotification`: UniffiCallbackInterfaceSyncNotificationListenerMethod0? = null, + `uniffiFree`: UniffiCallbackInterfaceFree? = null, + ): UniffiVTableCallbackInterfaceSyncNotificationListener(`onNotification`,`uniffiFree`,), Structure.ByValue + + internal fun uniffiSetValue(other: UniffiVTableCallbackInterfaceSyncNotificationListener) { + `onNotification` = other.`onNotification` + `uniffiFree` = other.`uniffiFree` + } + } @Structure.FieldOrder("onUpdate", "uniffiFree") internal open class UniffiVTableCallbackInterfaceSyncServiceStateObserver( @@ -2494,6 +2652,106 @@ internal open class UniffiVTableCallbackInterfaceWidgetCapabilitiesProvider( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2576,12 +2834,16 @@ fun uniffi_matrix_sdk_ffi_checksum_func_suggested_power_level_for_role( ): Short fun uniffi_matrix_sdk_ffi_checksum_func_suggested_role_for_power_level( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_checkcodesender_send( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_client_abort_oidc_auth( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_client_account_data( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_client_account_url( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_client_add_recent_emoji( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_client_available_sliding_sync_versions( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_client_avatar_url( @@ -2632,6 +2894,8 @@ fun uniffi_matrix_sdk_ffi_checksum_method_client_get_notification_settings( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_client_get_profile( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_client_get_recent_emojis( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_client_get_recently_visited_rooms( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_client_get_room( @@ -2642,6 +2906,8 @@ fun uniffi_matrix_sdk_ffi_checksum_method_client_get_room_preview_from_room_id( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_client_get_session_verification_controller( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_client_get_store_sizes( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_client_get_url( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_client_homeserver( @@ -2670,19 +2936,27 @@ fun uniffi_matrix_sdk_ffi_checksum_method_client_login_with_email( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_client_login_with_oidc_callback( ): Short -fun uniffi_matrix_sdk_ffi_checksum_method_client_login_with_qr_code( -): Short fun uniffi_matrix_sdk_ffi_checksum_method_client_logout( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_client_new_grant_login_with_qr_code_handler( +): Short +fun uniffi_matrix_sdk_ffi_checksum_method_client_new_login_with_qr_code_handler( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_client_notification_client( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_client_observe_account_data_event( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_client_observe_room_account_data_event( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_client_optimize_stores( +): Short +fun uniffi_matrix_sdk_ffi_checksum_method_client_register_notification_handler( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_client_remove_avatar( ): Short -fun uniffi_matrix_sdk_ffi_checksum_method_client_reset_server_info( +fun uniffi_matrix_sdk_ffi_checksum_method_client_reset_supported_versions( +): Short +fun uniffi_matrix_sdk_ffi_checksum_method_client_reset_well_known( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_client_resolve_room_alias( ): Short @@ -2734,6 +3008,8 @@ fun uniffi_matrix_sdk_ffi_checksum_method_client_subscribe_to_room_info( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_client_subscribe_to_send_queue_status( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_client_subscribe_to_send_queue_updates( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_client_sync_service( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_client_track_recently_visited_room( @@ -2776,6 +3052,8 @@ fun uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_enable_share_history_on_ ): Short fun uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_homeserver_url( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_in_memory_store( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_proxy( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_request_config( @@ -2786,20 +3064,14 @@ fun uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_server_name( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_server_name_or_homeserver_url( ): Short -fun uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_session_cache_size( -): Short -fun uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_session_journal_size_limit( -): Short -fun uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_session_passphrase( -): Short fun uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_session_paths( ): Short -fun uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_session_pool_max_size( -): Short fun uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_set_session_delegate( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_sliding_sync_version_builder( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_sqlite_store( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_system_is_memory_constrained( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_threads_enabled( @@ -2824,6 +3096,8 @@ fun uniffi_matrix_sdk_ffi_checksum_method_encryption_enable_backups( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_encryption_enable_recovery( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_encryption_has_devices_to_verify_against( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_encryption_is_last_device( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_encryption_recover( @@ -2848,6 +3122,10 @@ fun uniffi_matrix_sdk_ffi_checksum_method_encryption_wait_for_backup_upload_stea ): Short fun uniffi_matrix_sdk_ffi_checksum_method_encryption_wait_for_e2ee_initialization_tasks( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_grantloginwithqrcodehandler_generate( +): Short +fun uniffi_matrix_sdk_ffi_checksum_method_grantloginwithqrcodehandler_scan( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_homeserverlogindetails_sliding_sync_version( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_homeserverlogindetails_supported_oidc_prompts( @@ -2886,6 +3164,14 @@ fun uniffi_matrix_sdk_ffi_checksum_method_lazytimelineitemprovider_get_send_hand ): Short fun uniffi_matrix_sdk_ffi_checksum_method_lazytimelineitemprovider_get_shields( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_leavespacehandle_leave( +): Short +fun uniffi_matrix_sdk_ffi_checksum_method_leavespacehandle_rooms( +): Short +fun uniffi_matrix_sdk_ffi_checksum_method_loginwithqrcodehandler_generate( +): Short +fun uniffi_matrix_sdk_ffi_checksum_method_loginwithqrcodehandler_scan( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_mediafilehandle_path( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_mediafilehandle_persist( @@ -2908,6 +3194,8 @@ fun uniffi_matrix_sdk_ffi_checksum_method_notificationsettings_contains_keywords ): Short fun uniffi_matrix_sdk_ffi_checksum_method_notificationsettings_get_default_room_notification_mode( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_notificationsettings_get_raw_push_rules( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_notificationsettings_get_room_notification_settings( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_notificationsettings_get_rooms_with_user_defined_rules( @@ -2962,6 +3250,8 @@ fun uniffi_matrix_sdk_ffi_checksum_method_room_clear_composer_draft( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_room_clear_event_cache_storage( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_room_decline_call( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_room_discard_room_key( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_room_display_name( @@ -3022,6 +3312,10 @@ fun uniffi_matrix_sdk_ffi_checksum_method_room_leave( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_room_load_composer_draft( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_room_load_or_fetch_event( +): Short +fun uniffi_matrix_sdk_ffi_checksum_method_room_mark_as_fully_read_unchecked( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_room_mark_as_read( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_room_matrix_to_event_permalink( @@ -3092,6 +3386,8 @@ fun uniffi_matrix_sdk_ffi_checksum_method_room_start_live_location_share( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_room_stop_live_location_share( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_room_subscribe_to_call_decline_events( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_room_subscribe_to_identity_status_changes( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_room_subscribe_to_knock_requests( @@ -3100,6 +3396,8 @@ fun uniffi_matrix_sdk_ffi_checksum_method_room_subscribe_to_live_location_shares ): Short fun uniffi_matrix_sdk_ffi_checksum_method_room_subscribe_to_room_info_updates( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_room_subscribe_to_send_queue_updates( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_room_subscribe_to_typing_notifications( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_room_successor_room( @@ -3142,6 +3440,8 @@ fun uniffi_matrix_sdk_ffi_checksum_method_roomdirectorysearch_search( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_roomlist_entries_with_dynamic_adapters( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_roomlist_entries_with_dynamic_adapters_with( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_roomlist_loading_state( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_roomlist_room( @@ -3262,12 +3562,26 @@ fun uniffi_matrix_sdk_ffi_checksum_method_spaceroomlist_pagination_state( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_spaceroomlist_rooms( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_spaceroomlist_space( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_spaceroomlist_subscribe_to_pagination_state_updates( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_spaceroomlist_subscribe_to_room_update( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_spaceroomlist_subscribe_to_space_updates( +): Short +fun uniffi_matrix_sdk_ffi_checksum_method_spaceservice_add_child_to_space( +): Short +fun uniffi_matrix_sdk_ffi_checksum_method_spaceservice_editable_spaces( +): Short +fun uniffi_matrix_sdk_ffi_checksum_method_spaceservice_joined_parents_of_child( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_spaceservice_joined_spaces( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_spaceservice_leave_space( +): Short +fun uniffi_matrix_sdk_ffi_checksum_method_spaceservice_remove_child_from_space( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_spaceservice_space_room_list( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_spaceservice_subscribe_to_joined_spaces( @@ -3278,6 +3592,16 @@ fun uniffi_matrix_sdk_ffi_checksum_method_span_exit( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_span_is_none( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_sqlitestorebuilder_cache_size( +): Short +fun uniffi_matrix_sdk_ffi_checksum_method_sqlitestorebuilder_journal_size_limit( +): Short +fun uniffi_matrix_sdk_ffi_checksum_method_sqlitestorebuilder_passphrase( +): Short +fun uniffi_matrix_sdk_ffi_checksum_method_sqlitestorebuilder_pool_max_size( +): Short +fun uniffi_matrix_sdk_ffi_checksum_method_sqlitestorebuilder_system_is_memory_constrained( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_ssohandler_finish( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_ssohandler_url( @@ -3324,6 +3648,8 @@ fun uniffi_matrix_sdk_ffi_checksum_method_timeline_fetch_members( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_timeline_get_event_timeline_item_by_event_id( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_timeline_latest_event_id( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_timeline_load_reply_details( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_timeline_mark_as_read( @@ -3372,6 +3698,8 @@ fun uniffi_matrix_sdk_ffi_checksum_method_timelineevent_event_type( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_timelineevent_sender_id( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_timelineevent_thread_root_event_id( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_timelineevent_timestamp( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_timelineitem_as_event( @@ -3418,6 +3746,10 @@ fun uniffi_matrix_sdk_ffi_checksum_constructor_span_current( ): Short fun uniffi_matrix_sdk_ffi_checksum_constructor_span_new( ): Short +fun uniffi_matrix_sdk_ffi_checksum_constructor_span_new_bridge_span( +): Short +fun uniffi_matrix_sdk_ffi_checksum_constructor_sqlitestorebuilder_new( +): Short fun uniffi_matrix_sdk_ffi_checksum_constructor_timelineeventtypefilter_exclude( ): Short fun uniffi_matrix_sdk_ffi_checksum_constructor_timelineeventtypefilter_include( @@ -3428,6 +3760,8 @@ fun uniffi_matrix_sdk_ffi_checksum_method_backupstatelistener_on_update( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_backupsteadystatelistener_on_update( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_calldeclinelistener_call( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_clientdelegate_did_receive_auth_error( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_clientsessiondelegate_retrieve_session_from_keychain( @@ -3436,6 +3770,12 @@ fun uniffi_matrix_sdk_ffi_checksum_method_clientsessiondelegate_save_session_in_ ): Short fun uniffi_matrix_sdk_ffi_checksum_method_enablerecoveryprogresslistener_on_update( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_generatedqrloginprogresslistener_on_update( +): Short +fun uniffi_matrix_sdk_ffi_checksum_method_grantgeneratedqrloginprogresslistener_on_update( +): Short +fun uniffi_matrix_sdk_ffi_checksum_method_grantqrloginprogresslistener_on_update( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_identitystatuschangelistener_call( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_ignoreduserslistener_call( @@ -3470,8 +3810,12 @@ fun uniffi_matrix_sdk_ffi_checksum_method_roomlistservicestatelistener_on_update ): Short fun uniffi_matrix_sdk_ffi_checksum_method_roomlistservicesyncindicatorlistener_on_update( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_sendqueuelistener_on_update( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_sendqueueroomerrorlistener_on_error( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_sendqueueroomupdatelistener_on_update( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_sessionverificationcontrollerdelegate_did_receive_verification_request( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_sessionverificationcontrollerdelegate_did_accept_verification_request( @@ -3490,8 +3834,12 @@ fun uniffi_matrix_sdk_ffi_checksum_method_spaceroomlistentrieslistener_on_update ): Short fun uniffi_matrix_sdk_ffi_checksum_method_spaceroomlistpaginationstatelistener_on_update( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_spaceroomlistspacelistener_on_update( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_spaceservicejoinedspaceslistener_on_update( ): Short +fun uniffi_matrix_sdk_ffi_checksum_method_syncnotificationlistener_on_notification( +): Short fun uniffi_matrix_sdk_ffi_checksum_method_syncservicestateobserver_on_update( ): Short fun uniffi_matrix_sdk_ffi_checksum_method_timelinelistener_on_update( @@ -3545,9 +3893,13 @@ internal interface UniffiLib : Library { uniffiCallbackInterfaceAccountDataListener.register(lib) uniffiCallbackInterfaceBackupStateListener.register(lib) uniffiCallbackInterfaceBackupSteadyStateListener.register(lib) + uniffiCallbackInterfaceCallDeclineListener.register(lib) uniffiCallbackInterfaceClientDelegate.register(lib) uniffiCallbackInterfaceClientSessionDelegate.register(lib) uniffiCallbackInterfaceEnableRecoveryProgressListener.register(lib) + uniffiCallbackInterfaceGeneratedQrLoginProgressListener.register(lib) + uniffiCallbackInterfaceGrantGeneratedQrLoginProgressListener.register(lib) + uniffiCallbackInterfaceGrantQrLoginProgressListener.register(lib) uniffiCallbackInterfaceIdentityStatusChangeListener.register(lib) uniffiCallbackInterfaceIgnoredUsersListener.register(lib) uniffiCallbackInterfaceKnockRequestsListener.register(lib) @@ -3565,11 +3917,15 @@ internal interface UniffiLib : Library { uniffiCallbackInterfaceRoomListLoadingStateListener.register(lib) uniffiCallbackInterfaceRoomListServiceStateListener.register(lib) uniffiCallbackInterfaceRoomListServiceSyncIndicatorListener.register(lib) + uniffiCallbackInterfaceSendQueueListener.register(lib) uniffiCallbackInterfaceSendQueueRoomErrorListener.register(lib) + uniffiCallbackInterfaceSendQueueRoomUpdateListener.register(lib) uniffiCallbackInterfaceSessionVerificationControllerDelegate.register(lib) uniffiCallbackInterfaceSpaceRoomListEntriesListener.register(lib) uniffiCallbackInterfaceSpaceRoomListPaginationStateListener.register(lib) + uniffiCallbackInterfaceSpaceRoomListSpaceListener.register(lib) uniffiCallbackInterfaceSpaceServiceJoinedSpacesListener.register(lib) + uniffiCallbackInterfaceSyncNotificationListener.register(lib) uniffiCallbackInterfaceSyncServiceStateObserver.register(lib) uniffiCallbackInterfaceTimelineListener.register(lib) uniffiCallbackInterfaceTypingNotificationsListener.register(lib) @@ -3592,7 +3948,13 @@ internal interface UniffiLib : Library { } // FFI functions - fun uniffi_matrix_sdk_ffi_fn_clone_client(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, + fun uniffi_matrix_sdk_ffi_fn_clone_checkcodesender(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_matrix_sdk_ffi_fn_free_checkcodesender(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_matrix_sdk_ffi_fn_method_checkcodesender_send(`ptr`: Pointer,`code`: Byte, +): Long +fun uniffi_matrix_sdk_ffi_fn_clone_client(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_matrix_sdk_ffi_fn_free_client(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit @@ -3602,6 +3964,8 @@ fun uniffi_matrix_sdk_ffi_fn_method_client_account_data(`ptr`: Pointer,`eventTyp ): Long fun uniffi_matrix_sdk_ffi_fn_method_client_account_url(`ptr`: Pointer,`action`: RustBuffer.ByValue, ): Long +fun uniffi_matrix_sdk_ffi_fn_method_client_add_recent_emoji(`ptr`: Pointer,`emoji`: RustBuffer.ByValue, +): Long fun uniffi_matrix_sdk_ffi_fn_method_client_available_sliding_sync_versions(`ptr`: Pointer, ): Long fun uniffi_matrix_sdk_ffi_fn_method_client_avatar_url(`ptr`: Pointer, @@ -3652,6 +4016,8 @@ fun uniffi_matrix_sdk_ffi_fn_method_client_get_notification_settings(`ptr`: Poin ): Long fun uniffi_matrix_sdk_ffi_fn_method_client_get_profile(`ptr`: Pointer,`userId`: RustBuffer.ByValue, ): Long +fun uniffi_matrix_sdk_ffi_fn_method_client_get_recent_emojis(`ptr`: Pointer, +): Long fun uniffi_matrix_sdk_ffi_fn_method_client_get_recently_visited_rooms(`ptr`: Pointer, ): Long fun uniffi_matrix_sdk_ffi_fn_method_client_get_room(`ptr`: Pointer,`roomId`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, @@ -3662,6 +4028,8 @@ fun uniffi_matrix_sdk_ffi_fn_method_client_get_room_preview_from_room_id(`ptr`: ): Long fun uniffi_matrix_sdk_ffi_fn_method_client_get_session_verification_controller(`ptr`: Pointer, ): Long +fun uniffi_matrix_sdk_ffi_fn_method_client_get_store_sizes(`ptr`: Pointer, +): Long fun uniffi_matrix_sdk_ffi_fn_method_client_get_url(`ptr`: Pointer,`url`: RustBuffer.ByValue, ): Long fun uniffi_matrix_sdk_ffi_fn_method_client_homeserver(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -3690,19 +4058,27 @@ fun uniffi_matrix_sdk_ffi_fn_method_client_login_with_email(`ptr`: Pointer,`emai ): Long fun uniffi_matrix_sdk_ffi_fn_method_client_login_with_oidc_callback(`ptr`: Pointer,`callbackUrl`: RustBuffer.ByValue, ): Long -fun uniffi_matrix_sdk_ffi_fn_method_client_login_with_qr_code(`ptr`: Pointer,`qrCodeData`: Pointer,`oidcConfiguration`: RustBuffer.ByValue,`progressListener`: Long, -): Long fun uniffi_matrix_sdk_ffi_fn_method_client_logout(`ptr`: Pointer, ): Long +fun uniffi_matrix_sdk_ffi_fn_method_client_new_grant_login_with_qr_code_handler(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_matrix_sdk_ffi_fn_method_client_new_login_with_qr_code_handler(`ptr`: Pointer,`oidcConfiguration`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer fun uniffi_matrix_sdk_ffi_fn_method_client_notification_client(`ptr`: Pointer,`processSetup`: RustBuffer.ByValue, ): Long fun uniffi_matrix_sdk_ffi_fn_method_client_observe_account_data_event(`ptr`: Pointer,`eventType`: RustBuffer.ByValue,`listener`: Long,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_matrix_sdk_ffi_fn_method_client_observe_room_account_data_event(`ptr`: Pointer,`roomId`: RustBuffer.ByValue,`eventType`: RustBuffer.ByValue,`listener`: Long,uniffi_out_err: UniffiRustCallStatus, ): Pointer +fun uniffi_matrix_sdk_ffi_fn_method_client_optimize_stores(`ptr`: Pointer, +): Long +fun uniffi_matrix_sdk_ffi_fn_method_client_register_notification_handler(`ptr`: Pointer,`listener`: Long, +): Long fun uniffi_matrix_sdk_ffi_fn_method_client_remove_avatar(`ptr`: Pointer, ): Long -fun uniffi_matrix_sdk_ffi_fn_method_client_reset_server_info(`ptr`: Pointer, +fun uniffi_matrix_sdk_ffi_fn_method_client_reset_supported_versions(`ptr`: Pointer, +): Long +fun uniffi_matrix_sdk_ffi_fn_method_client_reset_well_known(`ptr`: Pointer, ): Long fun uniffi_matrix_sdk_ffi_fn_method_client_resolve_room_alias(`ptr`: Pointer,`roomAlias`: RustBuffer.ByValue, ): Long @@ -3754,6 +4130,8 @@ fun uniffi_matrix_sdk_ffi_fn_method_client_subscribe_to_room_info(`ptr`: Pointer ): Long fun uniffi_matrix_sdk_ffi_fn_method_client_subscribe_to_send_queue_status(`ptr`: Pointer,`listener`: Long,uniffi_out_err: UniffiRustCallStatus, ): Pointer +fun uniffi_matrix_sdk_ffi_fn_method_client_subscribe_to_send_queue_updates(`ptr`: Pointer,`listener`: Long, +): Long fun uniffi_matrix_sdk_ffi_fn_method_client_sync_service(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_matrix_sdk_ffi_fn_method_client_track_recently_visited_room(`ptr`: Pointer,`room`: RustBuffer.ByValue, @@ -3802,6 +4180,8 @@ fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_enable_share_history_on_invite ): Pointer fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_homeserver_url(`ptr`: Pointer,`url`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer +fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_in_memory_store(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_proxy(`ptr`: Pointer,`url`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_request_config(`ptr`: Pointer,`config`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, @@ -3812,20 +4192,14 @@ fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_server_name(`ptr`: Pointer,`se ): Pointer fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_server_name_or_homeserver_url(`ptr`: Pointer,`serverNameOrUrl`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer -fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_session_cache_size(`ptr`: Pointer,`cacheSize`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_session_journal_size_limit(`ptr`: Pointer,`limit`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, -): Pointer -fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_session_passphrase(`ptr`: Pointer,`passphrase`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, -): Pointer fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_session_paths(`ptr`: Pointer,`dataPath`: RustBuffer.ByValue,`cachePath`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer -fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_session_pool_max_size(`ptr`: Pointer,`poolMaxSize`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, -): Pointer fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_set_session_delegate(`ptr`: Pointer,`sessionDelegate`: Long,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_sliding_sync_version_builder(`ptr`: Pointer,`versionBuilder`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer +fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_sqlite_store(`ptr`: Pointer,`config`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_system_is_memory_constrained(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_matrix_sdk_ffi_fn_method_clientbuilder_threads_enabled(`ptr`: Pointer,`enabled`: Byte,`threadSubscriptions`: Byte,uniffi_out_err: UniffiRustCallStatus, @@ -3854,6 +4228,8 @@ fun uniffi_matrix_sdk_ffi_fn_method_encryption_enable_backups(`ptr`: Pointer, ): Long fun uniffi_matrix_sdk_ffi_fn_method_encryption_enable_recovery(`ptr`: Pointer,`waitForBackupsToUpload`: Byte,`passphrase`: RustBuffer.ByValue,`progressListener`: Long, ): Long +fun uniffi_matrix_sdk_ffi_fn_method_encryption_has_devices_to_verify_against(`ptr`: Pointer, +): Long fun uniffi_matrix_sdk_ffi_fn_method_encryption_is_last_device(`ptr`: Pointer, ): Long fun uniffi_matrix_sdk_ffi_fn_method_encryption_recover(`ptr`: Pointer,`recoveryKey`: RustBuffer.ByValue, @@ -3868,7 +4244,7 @@ fun uniffi_matrix_sdk_ffi_fn_method_encryption_reset_identity(`ptr`: Pointer, ): Long fun uniffi_matrix_sdk_ffi_fn_method_encryption_reset_recovery_key(`ptr`: Pointer, ): Long -fun uniffi_matrix_sdk_ffi_fn_method_encryption_user_identity(`ptr`: Pointer,`userId`: RustBuffer.ByValue, +fun uniffi_matrix_sdk_ffi_fn_method_encryption_user_identity(`ptr`: Pointer,`userId`: RustBuffer.ByValue,`fallbackToServer`: Byte, ): Long fun uniffi_matrix_sdk_ffi_fn_method_encryption_verification_state(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue @@ -3878,6 +4254,14 @@ fun uniffi_matrix_sdk_ffi_fn_method_encryption_wait_for_backup_upload_steady_sta ): Long fun uniffi_matrix_sdk_ffi_fn_method_encryption_wait_for_e2ee_initialization_tasks(`ptr`: Pointer, ): Long +fun uniffi_matrix_sdk_ffi_fn_clone_grantloginwithqrcodehandler(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_matrix_sdk_ffi_fn_free_grantloginwithqrcodehandler(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_matrix_sdk_ffi_fn_method_grantloginwithqrcodehandler_generate(`ptr`: Pointer,`progressListener`: Long, +): Long +fun uniffi_matrix_sdk_ffi_fn_method_grantloginwithqrcodehandler_scan(`ptr`: Pointer,`qrCodeData`: Pointer,`progressListener`: Long, +): Long fun uniffi_matrix_sdk_ffi_fn_clone_homeserverlogindetails(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_matrix_sdk_ffi_fn_free_homeserverlogindetails(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -3936,6 +4320,22 @@ fun uniffi_matrix_sdk_ffi_fn_method_lazytimelineitemprovider_get_send_handle(`pt ): RustBuffer.ByValue fun uniffi_matrix_sdk_ffi_fn_method_lazytimelineitemprovider_get_shields(`ptr`: Pointer,`strict`: Byte,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue +fun uniffi_matrix_sdk_ffi_fn_clone_leavespacehandle(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_matrix_sdk_ffi_fn_free_leavespacehandle(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_matrix_sdk_ffi_fn_method_leavespacehandle_leave(`ptr`: Pointer,`roomIds`: RustBuffer.ByValue, +): Long +fun uniffi_matrix_sdk_ffi_fn_method_leavespacehandle_rooms(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue +fun uniffi_matrix_sdk_ffi_fn_clone_loginwithqrcodehandler(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_matrix_sdk_ffi_fn_free_loginwithqrcodehandler(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_matrix_sdk_ffi_fn_method_loginwithqrcodehandler_generate(`ptr`: Pointer,`progressListener`: Long, +): Long +fun uniffi_matrix_sdk_ffi_fn_method_loginwithqrcodehandler_scan(`ptr`: Pointer,`qrCodeData`: Pointer,`progressListener`: Long, +): Long fun uniffi_matrix_sdk_ffi_fn_clone_mediafilehandle(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_matrix_sdk_ffi_fn_free_mediafilehandle(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -3978,6 +4378,8 @@ fun uniffi_matrix_sdk_ffi_fn_method_notificationsettings_contains_keywords_rules ): Long fun uniffi_matrix_sdk_ffi_fn_method_notificationsettings_get_default_room_notification_mode(`ptr`: Pointer,`isEncrypted`: Byte,`isOneToOne`: Byte, ): Long +fun uniffi_matrix_sdk_ffi_fn_method_notificationsettings_get_raw_push_rules(`ptr`: Pointer, +): Long fun uniffi_matrix_sdk_ffi_fn_method_notificationsettings_get_room_notification_settings(`ptr`: Pointer,`roomId`: RustBuffer.ByValue,`isEncrypted`: Byte,`isOneToOne`: Byte, ): Long fun uniffi_matrix_sdk_ffi_fn_method_notificationsettings_get_rooms_with_user_defined_rules(`ptr`: Pointer,`enabled`: RustBuffer.ByValue, @@ -4042,6 +4444,8 @@ fun uniffi_matrix_sdk_ffi_fn_method_room_clear_composer_draft(`ptr`: Pointer,`th ): Long fun uniffi_matrix_sdk_ffi_fn_method_room_clear_event_cache_storage(`ptr`: Pointer, ): Long +fun uniffi_matrix_sdk_ffi_fn_method_room_decline_call(`ptr`: Pointer,`rtcNotificationEventId`: RustBuffer.ByValue, +): Long fun uniffi_matrix_sdk_ffi_fn_method_room_discard_room_key(`ptr`: Pointer, ): Long fun uniffi_matrix_sdk_ffi_fn_method_room_display_name(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -4102,6 +4506,10 @@ fun uniffi_matrix_sdk_ffi_fn_method_room_leave(`ptr`: Pointer, ): Long fun uniffi_matrix_sdk_ffi_fn_method_room_load_composer_draft(`ptr`: Pointer,`threadRoot`: RustBuffer.ByValue, ): Long +fun uniffi_matrix_sdk_ffi_fn_method_room_load_or_fetch_event(`ptr`: Pointer,`eventId`: RustBuffer.ByValue, +): Long +fun uniffi_matrix_sdk_ffi_fn_method_room_mark_as_fully_read_unchecked(`ptr`: Pointer,`eventId`: RustBuffer.ByValue, +): Long fun uniffi_matrix_sdk_ffi_fn_method_room_mark_as_read(`ptr`: Pointer,`receiptType`: RustBuffer.ByValue, ): Long fun uniffi_matrix_sdk_ffi_fn_method_room_matrix_to_event_permalink(`ptr`: Pointer,`eventId`: RustBuffer.ByValue, @@ -4172,6 +4580,8 @@ fun uniffi_matrix_sdk_ffi_fn_method_room_start_live_location_share(`ptr`: Pointe ): Long fun uniffi_matrix_sdk_ffi_fn_method_room_stop_live_location_share(`ptr`: Pointer, ): Long +fun uniffi_matrix_sdk_ffi_fn_method_room_subscribe_to_call_decline_events(`ptr`: Pointer,`rtcNotificationEventId`: RustBuffer.ByValue,`listener`: Long,uniffi_out_err: UniffiRustCallStatus, +): Pointer fun uniffi_matrix_sdk_ffi_fn_method_room_subscribe_to_identity_status_changes(`ptr`: Pointer,`listener`: Long, ): Long fun uniffi_matrix_sdk_ffi_fn_method_room_subscribe_to_knock_requests(`ptr`: Pointer,`listener`: Long, @@ -4180,6 +4590,8 @@ fun uniffi_matrix_sdk_ffi_fn_method_room_subscribe_to_live_location_shares(`ptr` ): Pointer fun uniffi_matrix_sdk_ffi_fn_method_room_subscribe_to_room_info_updates(`ptr`: Pointer,`listener`: Long,uniffi_out_err: UniffiRustCallStatus, ): Pointer +fun uniffi_matrix_sdk_ffi_fn_method_room_subscribe_to_send_queue_updates(`ptr`: Pointer,`listener`: Long, +): Long fun uniffi_matrix_sdk_ffi_fn_method_room_subscribe_to_typing_notifications(`ptr`: Pointer,`listener`: Long,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_matrix_sdk_ffi_fn_method_room_successor_room(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -4230,6 +4642,8 @@ fun uniffi_matrix_sdk_ffi_fn_free_roomlist(`ptr`: Pointer,uniffi_out_err: Uniffi ): Unit fun uniffi_matrix_sdk_ffi_fn_method_roomlist_entries_with_dynamic_adapters(`ptr`: Pointer,`pageSize`: Int,`listener`: Long,uniffi_out_err: UniffiRustCallStatus, ): Pointer +fun uniffi_matrix_sdk_ffi_fn_method_roomlist_entries_with_dynamic_adapters_with(`ptr`: Pointer,`pageSize`: Int,`enableLatestEventSorter`: Byte,`listener`: Long,uniffi_out_err: UniffiRustCallStatus, +): Pointer fun uniffi_matrix_sdk_ffi_fn_method_roomlist_loading_state(`ptr`: Pointer,`listener`: Long,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_matrix_sdk_ffi_fn_method_roomlist_room(`ptr`: Pointer,`roomId`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, @@ -4402,16 +4816,30 @@ fun uniffi_matrix_sdk_ffi_fn_method_spaceroomlist_pagination_state(`ptr`: Pointe ): RustBufferSpaceRoomListPaginationState.ByValue fun uniffi_matrix_sdk_ffi_fn_method_spaceroomlist_rooms(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue +fun uniffi_matrix_sdk_ffi_fn_method_spaceroomlist_space(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue fun uniffi_matrix_sdk_ffi_fn_method_spaceroomlist_subscribe_to_pagination_state_updates(`ptr`: Pointer,`listener`: Long,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_matrix_sdk_ffi_fn_method_spaceroomlist_subscribe_to_room_update(`ptr`: Pointer,`listener`: Long,uniffi_out_err: UniffiRustCallStatus, ): Pointer +fun uniffi_matrix_sdk_ffi_fn_method_spaceroomlist_subscribe_to_space_updates(`ptr`: Pointer,`listener`: Long,uniffi_out_err: UniffiRustCallStatus, +): Pointer fun uniffi_matrix_sdk_ffi_fn_clone_spaceservice(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_matrix_sdk_ffi_fn_free_spaceservice(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit +fun uniffi_matrix_sdk_ffi_fn_method_spaceservice_add_child_to_space(`ptr`: Pointer,`childId`: RustBuffer.ByValue,`spaceId`: RustBuffer.ByValue, +): Long +fun uniffi_matrix_sdk_ffi_fn_method_spaceservice_editable_spaces(`ptr`: Pointer, +): Long +fun uniffi_matrix_sdk_ffi_fn_method_spaceservice_joined_parents_of_child(`ptr`: Pointer,`childId`: RustBuffer.ByValue, +): Long fun uniffi_matrix_sdk_ffi_fn_method_spaceservice_joined_spaces(`ptr`: Pointer, ): Long +fun uniffi_matrix_sdk_ffi_fn_method_spaceservice_leave_space(`ptr`: Pointer,`spaceId`: RustBuffer.ByValue, +): Long +fun uniffi_matrix_sdk_ffi_fn_method_spaceservice_remove_child_from_space(`ptr`: Pointer,`childId`: RustBuffer.ByValue,`spaceId`: RustBuffer.ByValue, +): Long fun uniffi_matrix_sdk_ffi_fn_method_spaceservice_space_room_list(`ptr`: Pointer,`spaceId`: RustBuffer.ByValue, ): Long fun uniffi_matrix_sdk_ffi_fn_method_spaceservice_subscribe_to_joined_spaces(`ptr`: Pointer,`listener`: Long, @@ -4422,7 +4850,9 @@ fun uniffi_matrix_sdk_ffi_fn_free_span(`ptr`: Pointer,uniffi_out_err: UniffiRust ): Unit fun uniffi_matrix_sdk_ffi_fn_constructor_span_current(uniffi_out_err: UniffiRustCallStatus, ): Pointer -fun uniffi_matrix_sdk_ffi_fn_constructor_span_new(`file`: RustBuffer.ByValue,`line`: RustBuffer.ByValue,`level`: RustBuffer.ByValue,`target`: RustBuffer.ByValue,`name`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +fun uniffi_matrix_sdk_ffi_fn_constructor_span_new(`file`: RustBuffer.ByValue,`line`: RustBuffer.ByValue,`level`: RustBuffer.ByValue,`target`: RustBuffer.ByValue,`name`: RustBuffer.ByValue,`bridgeTraceId`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_matrix_sdk_ffi_fn_constructor_span_new_bridge_span(`target`: RustBuffer.ByValue,`parentTraceId`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_matrix_sdk_ffi_fn_method_span_enter(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Unit @@ -4430,6 +4860,22 @@ fun uniffi_matrix_sdk_ffi_fn_method_span_exit(`ptr`: Pointer,uniffi_out_err: Uni ): Unit fun uniffi_matrix_sdk_ffi_fn_method_span_is_none(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Byte +fun uniffi_matrix_sdk_ffi_fn_clone_sqlitestorebuilder(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_matrix_sdk_ffi_fn_free_sqlitestorebuilder(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Unit +fun uniffi_matrix_sdk_ffi_fn_constructor_sqlitestorebuilder_new(`dataPath`: RustBuffer.ByValue,`cachePath`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_matrix_sdk_ffi_fn_method_sqlitestorebuilder_cache_size(`ptr`: Pointer,`cacheSize`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_matrix_sdk_ffi_fn_method_sqlitestorebuilder_journal_size_limit(`ptr`: Pointer,`limit`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_matrix_sdk_ffi_fn_method_sqlitestorebuilder_passphrase(`ptr`: Pointer,`passphrase`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_matrix_sdk_ffi_fn_method_sqlitestorebuilder_pool_max_size(`ptr`: Pointer,`poolMaxSize`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Pointer +fun uniffi_matrix_sdk_ffi_fn_method_sqlitestorebuilder_system_is_memory_constrained(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): Pointer fun uniffi_matrix_sdk_ffi_fn_clone_ssohandler(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_matrix_sdk_ffi_fn_free_ssohandler(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -4500,6 +4946,8 @@ fun uniffi_matrix_sdk_ffi_fn_method_timeline_fetch_members(`ptr`: Pointer, ): Long fun uniffi_matrix_sdk_ffi_fn_method_timeline_get_event_timeline_item_by_event_id(`ptr`: Pointer,`eventId`: RustBuffer.ByValue, ): Long +fun uniffi_matrix_sdk_ffi_fn_method_timeline_latest_event_id(`ptr`: Pointer, +): Long fun uniffi_matrix_sdk_ffi_fn_method_timeline_load_reply_details(`ptr`: Pointer,`eventIdStr`: RustBuffer.ByValue, ): Long fun uniffi_matrix_sdk_ffi_fn_method_timeline_mark_as_read(`ptr`: Pointer,`receiptType`: RustBuffer.ByValue, @@ -4552,6 +5000,8 @@ fun uniffi_matrix_sdk_ffi_fn_method_timelineevent_event_type(`ptr`: Pointer,unif ): RustBuffer.ByValue fun uniffi_matrix_sdk_ffi_fn_method_timelineevent_sender_id(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue +fun uniffi_matrix_sdk_ffi_fn_method_timelineevent_thread_root_event_id(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, +): RustBuffer.ByValue fun uniffi_matrix_sdk_ffi_fn_method_timelineevent_timestamp(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Long fun uniffi_matrix_sdk_ffi_fn_clone_timelineeventtypefilter(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus, @@ -4620,12 +5070,20 @@ fun uniffi_matrix_sdk_ffi_fn_init_callback_vtable_backupstatelistener(`vtable`: ): Unit fun uniffi_matrix_sdk_ffi_fn_init_callback_vtable_backupsteadystatelistener(`vtable`: UniffiVTableCallbackInterfaceBackupSteadyStateListener, ): Unit +fun uniffi_matrix_sdk_ffi_fn_init_callback_vtable_calldeclinelistener(`vtable`: UniffiVTableCallbackInterfaceCallDeclineListener, +): Unit fun uniffi_matrix_sdk_ffi_fn_init_callback_vtable_clientdelegate(`vtable`: UniffiVTableCallbackInterfaceClientDelegate, ): Unit fun uniffi_matrix_sdk_ffi_fn_init_callback_vtable_clientsessiondelegate(`vtable`: UniffiVTableCallbackInterfaceClientSessionDelegate, ): Unit fun uniffi_matrix_sdk_ffi_fn_init_callback_vtable_enablerecoveryprogresslistener(`vtable`: UniffiVTableCallbackInterfaceEnableRecoveryProgressListener, ): Unit +fun uniffi_matrix_sdk_ffi_fn_init_callback_vtable_generatedqrloginprogresslistener(`vtable`: UniffiVTableCallbackInterfaceGeneratedQrLoginProgressListener, +): Unit +fun uniffi_matrix_sdk_ffi_fn_init_callback_vtable_grantgeneratedqrloginprogresslistener(`vtable`: UniffiVTableCallbackInterfaceGrantGeneratedQrLoginProgressListener, +): Unit +fun uniffi_matrix_sdk_ffi_fn_init_callback_vtable_grantqrloginprogresslistener(`vtable`: UniffiVTableCallbackInterfaceGrantQrLoginProgressListener, +): Unit fun uniffi_matrix_sdk_ffi_fn_init_callback_vtable_identitystatuschangelistener(`vtable`: UniffiVTableCallbackInterfaceIdentityStatusChangeListener, ): Unit fun uniffi_matrix_sdk_ffi_fn_init_callback_vtable_ignoreduserslistener(`vtable`: UniffiVTableCallbackInterfaceIgnoredUsersListener, @@ -4660,16 +5118,24 @@ fun uniffi_matrix_sdk_ffi_fn_init_callback_vtable_roomlistservicestatelistener(` ): Unit fun uniffi_matrix_sdk_ffi_fn_init_callback_vtable_roomlistservicesyncindicatorlistener(`vtable`: UniffiVTableCallbackInterfaceRoomListServiceSyncIndicatorListener, ): Unit +fun uniffi_matrix_sdk_ffi_fn_init_callback_vtable_sendqueuelistener(`vtable`: UniffiVTableCallbackInterfaceSendQueueListener, +): Unit fun uniffi_matrix_sdk_ffi_fn_init_callback_vtable_sendqueueroomerrorlistener(`vtable`: UniffiVTableCallbackInterfaceSendQueueRoomErrorListener, ): Unit +fun uniffi_matrix_sdk_ffi_fn_init_callback_vtable_sendqueueroomupdatelistener(`vtable`: UniffiVTableCallbackInterfaceSendQueueRoomUpdateListener, +): Unit fun uniffi_matrix_sdk_ffi_fn_init_callback_vtable_sessionverificationcontrollerdelegate(`vtable`: UniffiVTableCallbackInterfaceSessionVerificationControllerDelegate, ): Unit fun uniffi_matrix_sdk_ffi_fn_init_callback_vtable_spaceroomlistentrieslistener(`vtable`: UniffiVTableCallbackInterfaceSpaceRoomListEntriesListener, ): Unit fun uniffi_matrix_sdk_ffi_fn_init_callback_vtable_spaceroomlistpaginationstatelistener(`vtable`: UniffiVTableCallbackInterfaceSpaceRoomListPaginationStateListener, ): Unit +fun uniffi_matrix_sdk_ffi_fn_init_callback_vtable_spaceroomlistspacelistener(`vtable`: UniffiVTableCallbackInterfaceSpaceRoomListSpaceListener, +): Unit fun uniffi_matrix_sdk_ffi_fn_init_callback_vtable_spaceservicejoinedspaceslistener(`vtable`: UniffiVTableCallbackInterfaceSpaceServiceJoinedSpacesListener, ): Unit +fun uniffi_matrix_sdk_ffi_fn_init_callback_vtable_syncnotificationlistener(`vtable`: UniffiVTableCallbackInterfaceSyncNotificationListener, +): Unit fun uniffi_matrix_sdk_ffi_fn_init_callback_vtable_syncservicestateobserver(`vtable`: UniffiVTableCallbackInterfaceSyncServiceStateObserver, ): Unit fun uniffi_matrix_sdk_ffi_fn_init_callback_vtable_timelinelistener(`vtable`: UniffiVTableCallbackInterfaceTimelineListener, @@ -4714,7 +5180,7 @@ fun uniffi_matrix_sdk_ffi_fn_func_message_event_content_from_markdown_as_emote(` ): Pointer fun uniffi_matrix_sdk_ffi_fn_func_message_event_content_new(`msgtype`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer -fun uniffi_matrix_sdk_ffi_fn_func_new_virtual_element_call_widget(`props`: RustBufferVirtualElementCallWidgetOptions.ByValue,uniffi_out_err: UniffiRustCallStatus, +fun uniffi_matrix_sdk_ffi_fn_func_new_virtual_element_call_widget(`props`: RustBufferVirtualElementCallWidgetProperties.ByValue,`config`: RustBufferVirtualElementCallWidgetConfig.ByValue,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue fun uniffi_matrix_sdk_ffi_fn_func_parse_matrix_entity_from(`uri`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue @@ -4902,7 +5368,7 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_func_message_event_content_new() != 57839.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_func_new_virtual_element_call_widget() != 61776.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_func_new_virtual_element_call_widget() != 7233.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_func_parse_matrix_entity_from() != 49710.toShort()) { @@ -4923,6 +5389,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_func_suggested_role_for_power_level() != 13856.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_checkcodesender_send() != 50179.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_abort_oidc_auth() != 53440.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -4932,6 +5401,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_account_url() != 42373.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_add_recent_emoji() != 29688.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_available_sliding_sync_versions() != 35296.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -5007,6 +5479,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_get_profile() != 60062.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_get_recent_emojis() != 43545.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_get_recently_visited_rooms() != 22399.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -5022,6 +5497,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_get_session_verification_controller() != 55934.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_get_store_sizes() != 30209.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_get_url() != 32541.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -5064,10 +5542,13 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_login_with_oidc_callback() != 32591.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_login_with_qr_code() != 3481.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_logout() != 42911.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_logout() != 42911.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_new_grant_login_with_qr_code_handler() != 48299.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_new_login_with_qr_code_handler() != 4124.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_notification_client() != 37308.toShort()) { @@ -5079,10 +5560,19 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_observe_room_account_data_event() != 15699.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_optimize_stores() != 18852.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_register_notification_handler() != 47103.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_remove_avatar() != 29033.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_reset_server_info() != 16333.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_reset_supported_versions() != 32820.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_reset_well_known() != 61934.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_resolve_room_alias() != 3551.toShort()) { @@ -5160,6 +5650,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_subscribe_to_send_queue_status() != 57403.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_subscribe_to_send_queue_updates() != 33603.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_client_sync_service() != 52812.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -5223,6 +5716,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_homeserver_url() != 28347.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_in_memory_store() != 28117.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_proxy() != 5659.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -5238,19 +5734,7 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_server_name_or_homeserver_url() != 30022.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_session_cache_size() != 32604.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_session_journal_size_limit() != 21378.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_session_passphrase() != 55403.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_session_paths() != 54230.toShort()) { - throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_session_pool_max_size() != 6011.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_session_paths() != 40778.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_set_session_delegate() != 8576.toShort()) { @@ -5259,7 +5743,10 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_sliding_sync_version_builder() != 39381.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_system_is_memory_constrained() != 6898.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_sqlite_store() != 55579.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_system_is_memory_constrained() != 30452.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_threads_enabled() != 23935.toShort()) { @@ -5295,6 +5782,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_encryption_enable_recovery() != 64351.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_encryption_has_devices_to_verify_against() != 7561.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_encryption_is_last_device() != 27955.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -5316,7 +5806,7 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_encryption_reset_recovery_key() != 20380.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_encryption_user_identity() != 20644.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_encryption_user_identity() != 17575.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_encryption_verification_state() != 29114.toShort()) { @@ -5331,6 +5821,12 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_encryption_wait_for_e2ee_initialization_tasks() != 41585.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_grantloginwithqrcodehandler_generate() != 56670.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_grantloginwithqrcodehandler_scan() != 60730.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_homeserverlogindetails_sliding_sync_version() != 36573.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -5388,6 +5884,18 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_lazytimelineitemprovider_get_shields() != 12518.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_leavespacehandle_leave() != 54036.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_leavespacehandle_rooms() != 50920.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_loginwithqrcodehandler_generate() != 59689.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_loginwithqrcodehandler_scan() != 53560.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_mediafilehandle_path() != 16357.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -5421,6 +5929,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_notificationsettings_get_default_room_notification_mode() != 36211.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_notificationsettings_get_raw_push_rules() != 17884.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_notificationsettings_get_room_notification_settings() != 55295.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -5502,6 +6013,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_clear_event_cache_storage() != 13838.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_decline_call() != 36115.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_discard_room_key() != 18081.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -5592,6 +6106,12 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_load_composer_draft() != 62856.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_load_or_fetch_event() != 12703.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_mark_as_fully_read_unchecked() != 24981.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_mark_as_read() != 57806.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -5697,6 +6217,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_stop_live_location_share() != 19983.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_subscribe_to_call_decline_events() != 62256.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_subscribe_to_identity_status_changes() != 8526.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -5709,6 +6232,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_subscribe_to_room_info_updates() != 48209.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_subscribe_to_send_queue_updates() != 17661.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_room_subscribe_to_typing_notifications() != 38524.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -5772,6 +6298,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlist_entries_with_dynamic_adapters() != 36097.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlist_entries_with_dynamic_adapters_with() != 21746.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlist_loading_state() != 21585.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -5952,15 +6481,36 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_spaceroomlist_rooms() != 24664.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_spaceroomlist_space() != 25368.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_spaceroomlist_subscribe_to_pagination_state_updates() != 16775.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_spaceroomlist_subscribe_to_room_update() != 55793.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_spaceroomlist_subscribe_to_space_updates() != 26327.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_spaceservice_add_child_to_space() != 31295.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_spaceservice_editable_spaces() != 62969.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_spaceservice_joined_parents_of_child() != 18724.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_spaceservice_joined_spaces() != 54285.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_spaceservice_leave_space() != 7949.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_spaceservice_remove_child_from_space() != 14438.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_spaceservice_space_room_list() != 6768.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -5976,6 +6526,21 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_span_is_none() != 33327.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_sqlitestorebuilder_cache_size() != 52005.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_sqlitestorebuilder_journal_size_limit() != 18671.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_sqlitestorebuilder_passphrase() != 58378.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_sqlitestorebuilder_pool_max_size() != 65399.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_sqlitestorebuilder_system_is_memory_constrained() != 16295.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_ssohandler_finish() != 64706.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -6045,10 +6610,13 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_get_event_timeline_item_by_event_id() != 33999.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_latest_event_id() != 18266.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_load_reply_details() != 54225.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_mark_as_read() != 16621.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_mark_as_read() != 20604.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_paginate_backwards() != 36829.toShort()) { @@ -6096,13 +6664,13 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_send_video() != 52974.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_send_voice_message() != 17589.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_send_voice_message() != 41701.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_subscribe_to_back_pagination_status() != 46161.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_toggle_reaction() != 29303.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_toggle_reaction() != 13555.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_method_timeline_unpin_event() != 52414.toShort()) { @@ -6117,6 +6685,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_timelineevent_sender_id() != 18142.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_timelineevent_thread_root_event_id() != 56465.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_timelineevent_timestamp() != 50929.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -6183,7 +6754,13 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_constructor_span_current() != 53698.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_matrix_sdk_ffi_checksum_constructor_span_new() != 14105.toShort()) { + if (lib.uniffi_matrix_sdk_ffi_checksum_constructor_span_new() != 8957.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_matrix_sdk_ffi_checksum_constructor_span_new_bridge_span() != 63835.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_matrix_sdk_ffi_checksum_constructor_sqlitestorebuilder_new() != 51363.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_matrix_sdk_ffi_checksum_constructor_timelineeventtypefilter_exclude() != 53805.toShort()) { @@ -6201,6 +6778,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_backupsteadystatelistener_on_update() != 41052.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_calldeclinelistener_call() != 13016.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_clientdelegate_did_receive_auth_error() != 26350.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -6213,6 +6793,15 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_enablerecoveryprogresslistener_on_update() != 13538.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_generatedqrloginprogresslistener_on_update() != 28731.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_grantgeneratedqrloginprogresslistener_on_update() != 2320.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_grantqrloginprogresslistener_on_update() != 35830.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_identitystatuschangelistener_call() != 57311.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -6264,9 +6853,15 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_roomlistservicesyncindicatorlistener_on_update() != 36937.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_sendqueuelistener_on_update() != 24843.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_sendqueueroomerrorlistener_on_error() != 38224.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_sendqueueroomupdatelistener_on_update() != 11544.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_sessionverificationcontrollerdelegate_did_receive_verification_request() != 3417.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -6294,9 +6889,15 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_matrix_sdk_ffi_checksum_method_spaceroomlistpaginationstatelistener_on_update() != 11960.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_spaceroomlistspacelistener_on_update() != 39714.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_spaceservicejoinedspaceslistener_on_update() != 19262.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_matrix_sdk_ffi_checksum_method_syncnotificationlistener_on_notification() != 38017.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_matrix_sdk_ffi_checksum_method_syncservicestateobserver_on_update() != 62231.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -6667,6 +7268,29 @@ public object FfiConverterLong: FfiConverter { } } +/** + * @suppress + */ +public object FfiConverterFloat: FfiConverter { + override fun lift(value: Float): Float { + return value + } + + override fun read(buf: ByteBuffer): Float { + return buf.getFloat() + } + + override fun lower(value: Float): Float { + return value + } + + override fun allocationSize(value: Float) = 4UL + + override fun write(value: Float, buf: ByteBuffer) { + buf.putFloat(value) + } +} + /** * @suppress */ @@ -6929,6 +7553,278 @@ public object FfiConverterDuration: FfiConverterRustBuffer { // +/** + * Used to pass back the [`CheckCode`] entered by the user to verify that the + * secure channel is indeed secure. + */ +public interface CheckCodeSenderInterface { + + /** + * Send the [`CheckCode`]. + * + * Calling this method more than once will result in an error. + * + * # Arguments + * + * * `check_code` - The check code in digits representation. + */ + suspend fun `send`(`code`: kotlin.UByte) + + companion object +} + +/** + * Used to pass back the [`CheckCode`] entered by the user to verify that the + * secure channel is indeed secure. + */ +open class CheckCodeSender: Disposable, AutoCloseable, CheckCodeSenderInterface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + /** + * This constructor can be used to instantiate a fake object. Only used for tests. Any + * attempt to actually use an object constructed this way will fail as there is no + * connected Rust object. + */ + @Suppress("UNUSED_PARAMETER") + constructor(noPointer: NoPointer) { + this.pointer = null + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + protected val pointer: Pointer? + protected val cleanable: UniffiCleaner.Cleanable + + private val wasDestroyed = AtomicBoolean(false) + private val callCounter = AtomicLong(1) + + override fun destroy() { + // Only allow a single call to this method. + // TODO: maybe we should log a warning if called more than once? + if (this.wasDestroyed.compareAndSet(false, true)) { + // This decrement always matches the initial count of 1 given at creation time. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + @Synchronized + override fun close() { + this.destroy() + } + + internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + do { + val c = this.callCounter.get() + if (c == 0L) { + throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed") + } + if (c == Long.MAX_VALUE) { + throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow") + } + } while (! this.callCounter.compareAndSet(c, c + 1L)) + // Now we can safely do the method call without the pointer being freed concurrently. + try { + return block(this.uniffiClonePointer()) + } finally { + // This decrement always matches the increment we performed above. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + // Use a static inner class instead of a closure so as not to accidentally + // capture `this` as part of the cleanable's action. + private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_checkcodesender(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_checkcodesender(pointer!!, status) + } + } + + + /** + * Send the [`CheckCode`]. + * + * Calling this method more than once will result in an error. + * + * # Arguments + * + * * `check_code` - The check code in digits representation. + */ + @Throws(HumanQrLoginException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `send`(`code`: kotlin.UByte) { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_checkcodesender_send( + thisPtr, + FfiConverterUByte.lower(`code`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + // lift function + { Unit }, + + // Error FFI converter + HumanQrLoginException.ErrorHandler, + ) + } + + + + + + companion object + +} + +/** + * @suppress + */ +public object FfiConverterTypeCheckCodeSender: FfiConverter { + + override fun lower(value: CheckCodeSender): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): CheckCodeSender { + return CheckCodeSender(value) + } + + override fun read(buf: ByteBuffer): CheckCodeSender { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) + } + + override fun allocationSize(value: CheckCodeSender) = 8UL + + override fun write(value: CheckCodeSender, buf: ByteBuffer) { + // The Rust code always expects pointers written as 8 bytes, + // and will fail to compile if they don't fit. + buf.putLong(Pointer.nativeValue(lower(value))) + } +} + + +// This template implements a class for working with a Rust struct via a Pointer/Arc +// to the live Rust struct on the other side of the FFI. +// +// Each instance implements core operations for working with the Rust `Arc` and the +// Kotlin Pointer to work with the live Rust struct on the other side of the FFI. +// +// There's some subtlety here, because we have to be careful not to operate on a Rust +// struct after it has been dropped, and because we must expose a public API for freeing +// theq Kotlin wrapper object in lieu of reliable finalizers. The core requirements are: +// +// * Each instance holds an opaque pointer to the underlying Rust struct. +// Method calls need to read this pointer from the object's state and pass it in to +// the Rust FFI. +// +// * When an instance is no longer needed, its pointer should be passed to a +// special destructor function provided by the Rust FFI, which will drop the +// underlying Rust struct. +// +// * Given an instance, calling code is expected to call the special +// `destroy` method in order to free it after use, either by calling it explicitly +// or by using a higher-level helper like the `use` method. Failing to do so risks +// leaking the underlying Rust struct. +// +// * We can't assume that calling code will do the right thing, and must be prepared +// to handle Kotlin method calls executing concurrently with or even after a call to +// `destroy`, and to handle multiple (possibly concurrent!) calls to `destroy`. +// +// * We must never allow Rust code to operate on the underlying Rust struct after +// the destructor has been called, and must never call the destructor more than once. +// Doing so may trigger memory unsafety. +// +// * To mitigate many of the risks of leaking memory and use-after-free unsafety, a `Cleaner` +// is implemented to call the destructor when the Kotlin object becomes unreachable. +// This is done in a background thread. This is not a panacea, and client code should be aware that +// 1. the thread may starve if some there are objects that have poorly performing +// `drop` methods or do significant work in their `drop` methods. +// 2. the thread is shared across the whole library. This can be tuned by using `android_cleaner = true`, +// or `android = true` in the [`kotlin` section of the `uniffi.toml` file](https://mozilla.github.io/uniffi-rs/kotlin/configuration.html). +// +// If we try to implement this with mutual exclusion on access to the pointer, there is the +// possibility of a race between a method call and a concurrent call to `destroy`: +// +// * Thread A starts a method call, reads the value of the pointer, but is interrupted +// before it can pass the pointer over the FFI to Rust. +// * Thread B calls `destroy` and frees the underlying Rust struct. +// * Thread A resumes, passing the already-read pointer value to Rust and triggering +// a use-after-free. +// +// One possible solution would be to use a `ReadWriteLock`, with each method call taking +// a read lock (and thus allowed to run concurrently) and the special `destroy` method +// taking a write lock (and thus blocking on live method calls). However, we aim not to +// generate methods with any hidden blocking semantics, and a `destroy` method that might +// block if called incorrectly seems to meet that bar. +// +// So, we achieve our goals by giving each instance an associated `AtomicLong` counter to track +// the number of in-flight method calls, and an `AtomicBoolean` flag to indicate whether `destroy` +// has been called. These are updated according to the following rules: +// +// * The initial value of the counter is 1, indicating a live object with no in-flight calls. +// The initial value for the flag is false. +// +// * At the start of each method call, we atomically check the counter. +// If it is 0 then the underlying Rust struct has already been destroyed and the call is aborted. +// If it is nonzero them we atomically increment it by 1 and proceed with the method call. +// +// * At the end of each method call, we atomically decrement and check the counter. +// If it has reached zero then we destroy the underlying Rust struct. +// +// * When `destroy` is called, we atomically flip the flag from false to true. +// If the flag was already true we silently fail. +// Otherwise we atomically decrement and check the counter. +// If it has reached zero then we destroy the underlying Rust struct. +// +// Astute readers may observe that this all sounds very similar to the way that Rust's `Arc` works, +// and indeed it is, with the addition of a flag to guard against multiple calls to `destroy`. +// +// The overall effect is that the underlying Rust struct is destroyed only when `destroy` has been +// called *and* all in-flight method calls have completed, avoiding violating any of the expectations +// of the underlying Rust code. +// +// This makes a cleaner a better alternative to _not_ calling `destroy()` as +// and when the object is finished with, but the abstraction is not perfect: if the Rust object's `drop` +// method is slow, and/or there are many objects to cleanup, and it's on a low end Android device, then the cleaner +// thread may be starved, and the app will leak memory. +// +// In this case, `destroy`ing manually may be a better solution. +// +// The cleaner can live side by side with the manual calling of `destroy`. In the order of responsiveness, uniffi objects +// with Rust peers are reclaimed: +// +// 1. By calling the `destroy` method of the object, which calls `rustObject.free()`. If that doesn't happen: +// 2. When the object becomes unreachable, AND the Cleaner thread gets to call `rustObject.free()`. If the thread is starved then: +// 3. The memory is reclaimed when the process terminates. +// +// [1] https://stackoverflow.com/questions/24376768/can-java-finalize-an-object-when-it-is-still-in-scope/24380219 +// + + public interface ClientInterface { /** @@ -6947,6 +7843,12 @@ public interface ClientInterface { suspend fun `accountUrl`(`action`: AccountManagementAction?): kotlin.String? + /** + * Adds a recently used emoji to the list and uploads the updated + * `io.element.recent_emoji` content to the global account data. + */ + suspend fun `addRecentEmoji`(`emoji`: kotlin.String) + /** * Find all sliding sync versions that are available. * @@ -7101,6 +8003,12 @@ public interface ClientInterface { suspend fun `getProfile`(`userId`: kotlin.String): UserProfile + /** + * Gets the list of recently used emojis from the + * `io.element.recent_emoji` global account data. + */ + suspend fun `getRecentEmojis`(): List + suspend fun `getRecentlyVisitedRooms`(): List /** @@ -7134,6 +8042,11 @@ public interface ClientInterface { suspend fun `getSessionVerificationController`(): SessionVerificationController + /** + * Returns the sizes of the existing stores, if known. + */ + suspend fun `getStoreSizes`(): StoreSizes + /** * Allows generic GET requests to be made through the SDK's internal HTTP * client. This is useful when the caller's native HTTP client wouldn't @@ -7221,24 +8134,26 @@ public interface ClientInterface { suspend fun `loginWithOidcCallback`(`callbackUrl`: kotlin.String) /** - * Log in using the provided [`QrCodeData`]. The `Client` must be built - * by providing [`QrCodeData::server_name`] as the server name for this - * login to succeed. - * - * This method uses the login mechanism described in [MSC4108]. As such - * this method requires OAuth 2.0 support as well as sliding sync support. - * - * The usage of the progress_listener is required to transfer the - * [`CheckCode`] to the existing client. - * - * [MSC4108]: https://github.com/matrix-org/matrix-spec-proposals/pull/4108 + * Log the current user out. */ - suspend fun `loginWithQrCode`(`qrCodeData`: QrCodeData, `oidcConfiguration`: OidcConfiguration, `progressListener`: QrLoginProgressListener) + suspend fun `logout`() /** - * Log the current user out. + * Create a handler for granting login from this device to a new device by + * way of a QR code. */ - suspend fun `logout`() + fun `newGrantLoginWithQrCodeHandler`(): GrantLoginWithQrCodeHandler + + /** + * Create a handler for requesting an existing device to grant login to + * this device by way of a QR code. + * + * # Arguments + * + * * `oidc_configuration` - The data to restore or register the client with + * the server. + */ + fun `newLoginWithQrCodeHandler`(`oidcConfiguration`: OidcConfiguration): LoginWithQrCodeHandler suspend fun `notificationClient`(`processSetup`: NotificationProcessSetup): NotificationClient @@ -7260,16 +8175,46 @@ public interface ClientInterface { */ fun `observeRoomAccountDataEvent`(`roomId`: kotlin.String, `eventType`: RoomAccountDataEventType, `listener`: RoomAccountDataListener): TaskHandle + /** + * Perform database optimizations if any are available, i.e. vacuuming in + * SQLite. + */ + suspend fun `optimizeStores`() + + /** + * Register a handler for notifications generated from sync responses. + * + * The handler will be called during sync for each event that triggers + * a notification based on the user's push rules. + * + * The handler receives: + * - The notification with push actions and event data + * - The room ID where the notification occurred + * + * This is useful for implementing custom notification logic, such as + * displaying local notifications or updating notification badges. + */ + suspend fun `registerNotificationHandler`(`listener`: SyncNotificationListener) + suspend fun `removeAvatar`() /** * Empty the server version and unstable features cache. * - * Since the SDK caches server info (versions, unstable features, - * well-known etc), it's possible to have a stale entry in the cache. - * This functions makes it possible to force reset it. + * Since the SDK caches the supported versions, it's possible to have a + * stale entry in the cache. This functions makes it possible to force + * reset it. + */ + suspend fun `resetSupportedVersions`() + + /** + * Empty the well-known cache. + * + * Since the SDK caches the well-known, it's possible to have a stale + * entry in the cache. This functions makes it possible to force reset + * it. */ - suspend fun `resetServerInfo`() + suspend fun `resetWellKnown`() /** * Resolves the given room alias to a room ID (and a list of servers), if @@ -7413,6 +8358,16 @@ public interface ClientInterface { */ fun `subscribeToSendQueueStatus`(`listener`: SendQueueRoomErrorListener): TaskHandle + /** + * Subscribe to the global send queue update reporter, at the + * client-wide level. + * + * The given listener will be immediately called with + * `RoomSendQueueUpdate::NewLocalEvent` for each local echo existing in + * the queue. + */ + suspend fun `subscribeToSendQueueUpdates`(`listener`: SendQueueRoomUpdateListener): TaskHandle + fun `syncService`(): SyncServiceBuilder suspend fun `trackRecentlyVisitedRoom`(`room`: kotlin.String) @@ -7625,6 +8580,32 @@ open class Client: Disposable, AutoCloseable, ClientInterface } + /** + * Adds a recently used emoji to the list and uploads the updated + * `io.element.recent_emoji` content to the global account data. + */ + @Throws(ClientException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `addRecentEmoji`(`emoji`: kotlin.String) { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_add_recent_emoji( + thisPtr, + FfiConverterString.lower(`emoji`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + // lift function + { Unit }, + + // Error FFI converter + ClientException.ErrorHandler, + ) + } + + /** * Find all sliding sync versions that are available. * @@ -8212,6 +9193,31 @@ open class Client: Disposable, AutoCloseable, ClientInterface } + /** + * Gets the list of recently used emojis from the + * `io.element.recent_emoji` global account data. + */ + @Throws(ClientException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `getRecentEmojis`() : List { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_get_recent_emojis( + thisPtr, + + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterSequenceTypeRecentEmoji.lift(it) }, + // Error FFI converter + ClientException.ErrorHandler, + ) + } + + @Throws(ClientException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") override suspend fun `getRecentlyVisitedRooms`() : List { @@ -8332,6 +9338,30 @@ open class Client: Disposable, AutoCloseable, ClientInterface } + /** + * Returns the sizes of the existing stores, if known. + */ + @Throws(ClientException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `getStoreSizes`() : StoreSizes { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_get_store_sizes( + thisPtr, + + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterTypeStoreSizes.lift(it) }, + // Error FFI converter + ClientException.ErrorHandler, + ) + } + + /** * Allows generic GET requests to be made through the SDK's internal HTTP * client. This is useful when the caller's native HTTP client wouldn't @@ -8678,41 +9708,6 @@ open class Client: Disposable, AutoCloseable, ClientInterface } - /** - * Log in using the provided [`QrCodeData`]. The `Client` must be built - * by providing [`QrCodeData::server_name`] as the server name for this - * login to succeed. - * - * This method uses the login mechanism described in [MSC4108]. As such - * this method requires OAuth 2.0 support as well as sliding sync support. - * - * The usage of the progress_listener is required to transfer the - * [`CheckCode`] to the existing client. - * - * [MSC4108]: https://github.com/matrix-org/matrix-spec-proposals/pull/4108 - */ - @Throws(HumanQrLoginException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `loginWithQrCode`(`qrCodeData`: QrCodeData, `oidcConfiguration`: OidcConfiguration, `progressListener`: QrLoginProgressListener) { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_login_with_qr_code( - thisPtr, - FfiConverterTypeQrCodeData.lower(`qrCodeData`),FfiConverterTypeOidcConfiguration.lower(`oidcConfiguration`),FfiConverterTypeQrLoginProgressListener.lower(`progressListener`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, - // lift function - { Unit }, - - // Error FFI converter - HumanQrLoginException.ErrorHandler, - ) - } - - /** * Log the current user out. */ @@ -8738,6 +9733,43 @@ open class Client: Disposable, AutoCloseable, ClientInterface } + /** + * Create a handler for granting login from this device to a new device by + * way of a QR code. + */override fun `newGrantLoginWithQrCodeHandler`(): GrantLoginWithQrCodeHandler { + return FfiConverterTypeGrantLoginWithQrCodeHandler.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_new_grant_login_with_qr_code_handler( + it, _status) +} + } + ) + } + + + + /** + * Create a handler for requesting an existing device to grant login to + * this device by way of a QR code. + * + * # Arguments + * + * * `oidc_configuration` - The data to restore or register the client with + * the server. + */override fun `newLoginWithQrCodeHandler`(`oidcConfiguration`: OidcConfiguration): LoginWithQrCodeHandler { + return FfiConverterTypeLoginWithQrCodeHandler.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_new_login_with_qr_code_handler( + it, FfiConverterTypeOidcConfiguration.lower(`oidcConfiguration`),_status) +} + } + ) + } + + + @Throws(ClientException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") override suspend fun `notificationClient`(`processSetup`: NotificationProcessSetup) : NotificationClient { @@ -8798,6 +9830,66 @@ open class Client: Disposable, AutoCloseable, ClientInterface + /** + * Perform database optimizations if any are available, i.e. vacuuming in + * SQLite. + */ + @Throws(ClientException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `optimizeStores`() { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_optimize_stores( + thisPtr, + + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + // lift function + { Unit }, + + // Error FFI converter + ClientException.ErrorHandler, + ) + } + + + /** + * Register a handler for notifications generated from sync responses. + * + * The handler will be called during sync for each event that triggers + * a notification based on the user's push rules. + * + * The handler receives: + * - The notification with push actions and event data + * - The room ID where the notification occurred + * + * This is useful for implementing custom notification logic, such as + * displaying local notifications or updating notification badges. + */ + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `registerNotificationHandler`(`listener`: SyncNotificationListener) { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_register_notification_handler( + thisPtr, + FfiConverterTypeSyncNotificationListener.lower(`listener`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + // lift function + { Unit }, + + // Error FFI converter + UniffiNullRustCallStatusErrorHandler, + ) + } + + @Throws(ClientException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") override suspend fun `removeAvatar`() { @@ -8823,16 +9915,45 @@ open class Client: Disposable, AutoCloseable, ClientInterface /** * Empty the server version and unstable features cache. * - * Since the SDK caches server info (versions, unstable features, - * well-known etc), it's possible to have a stale entry in the cache. - * This functions makes it possible to force reset it. + * Since the SDK caches the supported versions, it's possible to have a + * stale entry in the cache. This functions makes it possible to force + * reset it. */ @Throws(ClientException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `resetServerInfo`() { + override suspend fun `resetSupportedVersions`() { return uniffiRustCallAsync( callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_reset_server_info( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_reset_supported_versions( + thisPtr, + + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + // lift function + { Unit }, + + // Error FFI converter + ClientException.ErrorHandler, + ) + } + + + /** + * Empty the well-known cache. + * + * Since the SDK caches the well-known, it's possible to have a stale + * entry in the cache. This functions makes it possible to force reset + * it. + */ + @Throws(ClientException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `resetWellKnown`() { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_reset_well_known( thisPtr, ) @@ -9395,6 +10516,35 @@ open class Client: Disposable, AutoCloseable, ClientInterface } + + /** + * Subscribe to the global send queue update reporter, at the + * client-wide level. + * + * The given listener will be immediately called with + * `RoomSendQueueUpdate::NewLocalEvent` for each local echo existing in + * the queue. + */ + @Throws(ClientException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `subscribeToSendQueueUpdates`(`listener`: SendQueueRoomUpdateListener) : TaskHandle { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_client_subscribe_to_send_queue_updates( + thisPtr, + FfiConverterTypeSendQueueRoomUpdateListener.lower(`listener`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, + // lift function + { FfiConverterTypeTaskHandle.lift(it) }, + // Error FFI converter + ClientException.ErrorHandler, + ) + } + override fun `syncService`(): SyncServiceBuilder { return FfiConverterTypeSyncServiceBuilder.lift( callWithPointer { @@ -9764,6 +10914,11 @@ public interface ClientBuilderInterface { fun `homeserverUrl`(`url`: kotlin.String): ClientBuilder + /** + * Use in-memory session storage. + */ + fun `inMemoryStore`(): ClientBuilder + fun `proxy`(`url`: kotlin.String): ClientBuilder /** @@ -9782,73 +10937,32 @@ public interface ClientBuilderInterface { fun `serverNameOrHomeserverUrl`(`serverNameOrUrl`: kotlin.String): ClientBuilder /** - * Set the cache size for the SQLite stores given to - * [`ClientBuilder::session_paths`]. - * - * Each store exposes a SQLite connection. This method controls the cache - * size, in **bytes (!)**. - * - * The cache represents data SQLite holds in memory at once per open - * database file. The default cache implementation does not allocate the - * full amount of cache memory all at once. Cache memory is allocated - * in smaller chunks on an as-needed basis. - * - * See [`SqliteStoreConfig::cache_size`] to learn more. - */ - fun `sessionCacheSize`(`cacheSize`: kotlin.UInt?): ClientBuilder - - /** - * Set the size limit for the SQLite WAL files of stores given to - * [`ClientBuilder::session_paths`]. - * - * Each store uses the WAL journal mode. This method controls the size - * limit of the WAL files, in **bytes (!)**. - * - * See [`SqliteStoreConfig::journal_size_limit`] to learn more. - */ - fun `sessionJournalSizeLimit`(`limit`: kotlin.UInt?): ClientBuilder - - /** - * Set the passphrase for the stores given to - * [`ClientBuilder::session_paths`]. - */ - fun `sessionPassphrase`(`passphrase`: kotlin.String?): ClientBuilder - - /** - * Sets the paths that the client will use to store its data and caches. - * Both paths **must** be unique per session as the SDK stores aren't - * capable of handling multiple users, however it is valid to use the - * same path for both stores on a single session. + * Sets the paths that the client will use to store its data and caches + * with SQLite. * - * Leaving this unset tells the client to use an in-memory data store. + * Both paths **must** be unique per session as the SDK + * stores aren't capable of handling multiple users, however it is + * valid to use the same path for both stores on a single session. */ fun `sessionPaths`(`dataPath`: kotlin.String, `cachePath`: kotlin.String): ClientBuilder - /** - * Set the pool max size for the SQLite stores given to - * [`ClientBuilder::session_paths`]. - * - * Each store exposes an async pool of connections. This method controls - * the size of the pool. The larger the pool is, the more memory is - * consumed, but also the more the app is reactive because it doesn't need - * to wait on a pool to be available to run queries. - * - * See [`SqliteStoreConfig::pool_max_size`] to learn more. - */ - fun `sessionPoolMaxSize`(`poolMaxSize`: kotlin.UInt?): ClientBuilder - fun `setSessionDelegate`(`sessionDelegate`: ClientSessionDelegate): ClientBuilder fun `slidingSyncVersionBuilder`(`versionBuilder`: SlidingSyncVersionBuilder): ClientBuilder + /** + * Use SQLite as the session storage. + */ + fun `sqliteStore`(`config`: SqliteStoreBuilder): ClientBuilder + /** * Tell the client that the system is memory constrained, like in a push * notification process for example. * * So far, at the time of writing (2025-04-07), it changes the defaults of - * [`SqliteStoreConfig`], so one might not need to call - * [`ClientBuilder::session_cache_size`] and siblings for example. Please - * check [`SqliteStoreConfig::with_low_memory_config`]. + * `matrix_sdk::SqliteStoreConfig` (if the `sqlite` feature is enabled). + * Please check + * `matrix_sdk::SqliteStoreConfig::with_low_memory_config`. */ fun `systemIsMemoryConstrained`(): ClientBuilder @@ -10142,6 +11256,21 @@ open class ClientBuilder: Disposable, AutoCloseable, ClientBuilderInterface } + + /** + * Use in-memory session storage. + */override fun `inMemoryStore`(): ClientBuilder { + return FfiConverterTypeClientBuilder.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_in_memory_store( + it, _status) +} + } + ) + } + + override fun `proxy`(`url`: kotlin.String): ClientBuilder { return FfiConverterTypeClientBuilder.lift( callWithPointer { @@ -10211,75 +11340,12 @@ open class ClientBuilder: Disposable, AutoCloseable, ClientBuilderInterface /** - * Set the cache size for the SQLite stores given to - * [`ClientBuilder::session_paths`]. - * - * Each store exposes a SQLite connection. This method controls the cache - * size, in **bytes (!)**. - * - * The cache represents data SQLite holds in memory at once per open - * database file. The default cache implementation does not allocate the - * full amount of cache memory all at once. Cache memory is allocated - * in smaller chunks on an as-needed basis. + * Sets the paths that the client will use to store its data and caches + * with SQLite. * - * See [`SqliteStoreConfig::cache_size`] to learn more. - */override fun `sessionCacheSize`(`cacheSize`: kotlin.UInt?): ClientBuilder { - return FfiConverterTypeClientBuilder.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_session_cache_size( - it, FfiConverterOptionalUInt.lower(`cacheSize`),_status) -} - } - ) - } - - - - /** - * Set the size limit for the SQLite WAL files of stores given to - * [`ClientBuilder::session_paths`]. - * - * Each store uses the WAL journal mode. This method controls the size - * limit of the WAL files, in **bytes (!)**. - * - * See [`SqliteStoreConfig::journal_size_limit`] to learn more. - */override fun `sessionJournalSizeLimit`(`limit`: kotlin.UInt?): ClientBuilder { - return FfiConverterTypeClientBuilder.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_session_journal_size_limit( - it, FfiConverterOptionalUInt.lower(`limit`),_status) -} - } - ) - } - - - - /** - * Set the passphrase for the stores given to - * [`ClientBuilder::session_paths`]. - */override fun `sessionPassphrase`(`passphrase`: kotlin.String?): ClientBuilder { - return FfiConverterTypeClientBuilder.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_session_passphrase( - it, FfiConverterOptionalString.lower(`passphrase`),_status) -} - } - ) - } - - - - /** - * Sets the paths that the client will use to store its data and caches. - * Both paths **must** be unique per session as the SDK stores aren't - * capable of handling multiple users, however it is valid to use the - * same path for both stores on a single session. - * - * Leaving this unset tells the client to use an in-memory data store. + * Both paths **must** be unique per session as the SDK + * stores aren't capable of handling multiple users, however it is + * valid to use the same path for both stores on a single session. */override fun `sessionPaths`(`dataPath`: kotlin.String, `cachePath`: kotlin.String): ClientBuilder { return FfiConverterTypeClientBuilder.lift( callWithPointer { @@ -10292,47 +11358,39 @@ open class ClientBuilder: Disposable, AutoCloseable, ClientBuilderInterface } - - /** - * Set the pool max size for the SQLite stores given to - * [`ClientBuilder::session_paths`]. - * - * Each store exposes an async pool of connections. This method controls - * the size of the pool. The larger the pool is, the more memory is - * consumed, but also the more the app is reactive because it doesn't need - * to wait on a pool to be available to run queries. - * - * See [`SqliteStoreConfig::pool_max_size`] to learn more. - */override fun `sessionPoolMaxSize`(`poolMaxSize`: kotlin.UInt?): ClientBuilder { + override fun `setSessionDelegate`(`sessionDelegate`: ClientSessionDelegate): ClientBuilder { return FfiConverterTypeClientBuilder.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_session_pool_max_size( - it, FfiConverterOptionalUInt.lower(`poolMaxSize`),_status) + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_set_session_delegate( + it, FfiConverterTypeClientSessionDelegate.lower(`sessionDelegate`),_status) } } ) } - override fun `setSessionDelegate`(`sessionDelegate`: ClientSessionDelegate): ClientBuilder { + override fun `slidingSyncVersionBuilder`(`versionBuilder`: SlidingSyncVersionBuilder): ClientBuilder { return FfiConverterTypeClientBuilder.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_set_session_delegate( - it, FfiConverterTypeClientSessionDelegate.lower(`sessionDelegate`),_status) + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_sliding_sync_version_builder( + it, FfiConverterTypeSlidingSyncVersionBuilder.lower(`versionBuilder`),_status) } } ) } - override fun `slidingSyncVersionBuilder`(`versionBuilder`: SlidingSyncVersionBuilder): ClientBuilder { + + /** + * Use SQLite as the session storage. + */override fun `sqliteStore`(`config`: SqliteStoreBuilder): ClientBuilder { return FfiConverterTypeClientBuilder.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_sliding_sync_version_builder( - it, FfiConverterTypeSlidingSyncVersionBuilder.lower(`versionBuilder`),_status) + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_clientbuilder_sqlite_store( + it, FfiConverterTypeSqliteStoreBuilder.lower(`config`),_status) } } ) @@ -10345,9 +11403,9 @@ open class ClientBuilder: Disposable, AutoCloseable, ClientBuilderInterface * notification process for example. * * So far, at the time of writing (2025-04-07), it changes the defaults of - * [`SqliteStoreConfig`], so one might not need to call - * [`ClientBuilder::session_cache_size`] and siblings for example. Please - * check [`SqliteStoreConfig::with_low_memory_config`]. + * `matrix_sdk::SqliteStoreConfig` (if the `sqlite` feature is enabled). + * Please check + * `matrix_sdk::SqliteStoreConfig::with_low_memory_config`. */override fun `systemIsMemoryConstrained`(): ClientBuilder { return FfiConverterTypeClientBuilder.lift( callWithPointer { @@ -10572,6 +11630,15 @@ public interface EncryptionInterface { suspend fun `enableRecovery`(`waitForBackupsToUpload`: kotlin.Boolean, `passphrase`: kotlin.String?, `progressListener`: EnableRecoveryProgressListener): kotlin.String + /** + * Does the user have other devices that the current device can verify + * against? + * + * The device must be signed by the user's cross-signing key, must have an + * identity, and must not be a dehydrated device. + */ + suspend fun `hasDevicesToVerifyAgainst`(): kotlin.Boolean + suspend fun `isLastDevice`(): kotlin.Boolean suspend fun `recover`(`recoveryKey`: kotlin.String) @@ -10596,11 +11663,13 @@ public interface EncryptionInterface { * This method always tries to fetch the identity from the store, which we * only have if the user is tracked, meaning that we are both members * of the same encrypted room. If no user is found locally, a request will - * be made to the homeserver. + * be made to the homeserver unless `fallback_to_server` is set to `false`. * * # Arguments * * * `user_id` - The ID of the user that the identity belongs to. + * * `fallback_to_server` - Should we request the user identity from the + * homeserver if one isn't found locally. * * Returns a `UserIdentity` if one is found. Returns an error if there * was an issue with the crypto store or with the request to the @@ -10608,7 +11677,7 @@ public interface EncryptionInterface { * * This will always return `None` if the client hasn't been logged in. */ - suspend fun `userIdentity`(`userId`: kotlin.String): UserIdentity? + suspend fun `userIdentity`(`userId`: kotlin.String, `fallbackToServer`: kotlin.Boolean): UserIdentity? fun `verificationState`(): VerificationState @@ -10877,6 +11946,34 @@ open class Encryption: Disposable, AutoCloseable, EncryptionInterface } + /** + * Does the user have other devices that the current device can verify + * against? + * + * The device must be signed by the user's cross-signing key, must have an + * identity, and must not be a dehydrated device. + */ + @Throws(ClientException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `hasDevicesToVerifyAgainst`() : kotlin.Boolean { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_has_devices_to_verify_against( + thisPtr, + + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, + // lift function + { FfiConverterBoolean.lift(it) }, + // Error FFI converter + ClientException.ErrorHandler, + ) + } + + @Throws(RecoveryException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") override suspend fun `isLastDevice`() : kotlin.Boolean { @@ -11017,11 +12114,13 @@ open class Encryption: Disposable, AutoCloseable, EncryptionInterface * This method always tries to fetch the identity from the store, which we * only have if the user is tracked, meaning that we are both members * of the same encrypted room. If no user is found locally, a request will - * be made to the homeserver. + * be made to the homeserver unless `fallback_to_server` is set to `false`. * * # Arguments * * * `user_id` - The ID of the user that the identity belongs to. + * * `fallback_to_server` - Should we request the user identity from the + * homeserver if one isn't found locally. * * Returns a `UserIdentity` if one is found. Returns an error if there * was an issue with the crypto store or with the request to the @@ -11031,12 +12130,12 @@ open class Encryption: Disposable, AutoCloseable, EncryptionInterface */ @Throws(ClientException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `userIdentity`(`userId`: kotlin.String) : UserIdentity? { + override suspend fun `userIdentity`(`userId`: kotlin.String, `fallbackToServer`: kotlin.Boolean) : UserIdentity? { return uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_encryption_user_identity( thisPtr, - FfiConverterString.lower(`userId`), + FfiConverterString.lower(`userId`),FfiConverterBoolean.lower(`fallbackToServer`), ) }, { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, @@ -11255,43 +12354,62 @@ public object FfiConverterTypeEncryption: FfiConverter { // -public interface HomeserverLoginDetailsInterface { - - /** - * The sliding sync version. - */ - fun `slidingSyncVersion`(): SlidingSyncVersion - - /** - * The prompts advertised by the authentication issuer for use in the login - * URL. - */ - fun `supportedOidcPrompts`(): List - - /** - * Whether the current homeserver supports login using OIDC. - */ - fun `supportsOidcLogin`(): kotlin.Boolean - - /** - * Whether the current homeserver supports the password login flow. - */ - fun `supportsPasswordLogin`(): kotlin.Boolean +/** + * Handler for granting login in with a QR code. + */ +public interface GrantLoginWithQrCodeHandlerInterface { /** - * Whether the current homeserver supports login using legacy SSO. + * This method allows you to grant login by generating a QR code. + * + * This device needs to call this method and handle its progress updates to + * generate a QR code which the new device can scan to log in. + * + * This method uses the login mechanism described in [MSC4108]. As such, + * it requires OAuth 2.0 support. + * + * For the reverse flow where the existing device generates the QR code + * for this device to scan, use [`GrantLoginWithQrCodeHandler::scan`]. + * + * # Arguments + * + * * `progress_listener` - A progress listener that must also be used to + * obtain the [`QrCodeData`] and collect the [`CheckCode`] from the user. + * + * [MSC4108]: https://github.com/matrix-org/matrix-spec-proposals/pull/4108 */ - fun `supportsSsoLogin`(): kotlin.Boolean + suspend fun `generate`(`progressListener`: GrantGeneratedQrLoginProgressListener) /** - * The URL of the currently configured homeserver. + * This method allows you to grant login with a scanned QR code. + * + * The new device needs to display the QR code which this device can + * scan, call this method and handle its progress updates to grant the + * login. + * + * This method uses the login mechanism described in [MSC4108]. As such, + * it requires OAuth 2.0 support. + * + * For the reverse flow where this device generates the QR code for the + * existing device to scan, use [`GrantLoginWithQrCodeHandler::generate`]. + * + * # Arguments + * + * * `qr_code_data` - The [`QrCodeData`] scanned from the QR code. + * * `progress_listener` - A progress listener that must also be used to + * transfer the [`CheckCode`] to the new device. + * + * [MSC4108]: https://github.com/matrix-org/matrix-spec-proposals/pull/4108 */ - fun `url`(): kotlin.String + suspend fun `scan`(`qrCodeData`: QrCodeData, `progressListener`: GrantQrLoginProgressListener) companion object } -open class HomeserverLoginDetails: Disposable, AutoCloseable, HomeserverLoginDetailsInterface +/** + * Handler for granting login in with a QR code. + */ +open class GrantLoginWithQrCodeHandler: Disposable, AutoCloseable, GrantLoginWithQrCodeHandlerInterface { constructor(pointer: Pointer) { @@ -11361,7 +12479,7 @@ open class HomeserverLoginDetails: Disposable, AutoCloseable, HomeserverLoginDet override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_homeserverlogindetails(ptr, status) + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_grantloginwithqrcodehandler(ptr, status) } } } @@ -11369,100 +12487,93 @@ open class HomeserverLoginDetails: Disposable, AutoCloseable, HomeserverLoginDet fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_homeserverlogindetails(pointer!!, status) + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_grantloginwithqrcodehandler(pointer!!, status) } } /** - * The sliding sync version. - */override fun `slidingSyncVersion`(): SlidingSyncVersion { - return FfiConverterTypeSlidingSyncVersion.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_homeserverlogindetails_sliding_sync_version( - it, _status) -} - } - ) - } - - - - /** - * The prompts advertised by the authentication issuer for use in the login - * URL. - */override fun `supportedOidcPrompts`(): List { - return FfiConverterSequenceTypeOidcPrompt.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_homeserverlogindetails_supported_oidc_prompts( - it, _status) -} - } - ) - } - - - - /** - * Whether the current homeserver supports login using OIDC. - */override fun `supportsOidcLogin`(): kotlin.Boolean { - return FfiConverterBoolean.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_homeserverlogindetails_supports_oidc_login( - it, _status) -} - } - ) - } - - - - /** - * Whether the current homeserver supports the password login flow. - */override fun `supportsPasswordLogin`(): kotlin.Boolean { - return FfiConverterBoolean.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_homeserverlogindetails_supports_password_login( - it, _status) -} - } - ) - } - - - - /** - * Whether the current homeserver supports login using legacy SSO. - */override fun `supportsSsoLogin`(): kotlin.Boolean { - return FfiConverterBoolean.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_homeserverlogindetails_supports_sso_login( - it, _status) -} - } + * This method allows you to grant login by generating a QR code. + * + * This device needs to call this method and handle its progress updates to + * generate a QR code which the new device can scan to log in. + * + * This method uses the login mechanism described in [MSC4108]. As such, + * it requires OAuth 2.0 support. + * + * For the reverse flow where the existing device generates the QR code + * for this device to scan, use [`GrantLoginWithQrCodeHandler::scan`]. + * + * # Arguments + * + * * `progress_listener` - A progress listener that must also be used to + * obtain the [`QrCodeData`] and collect the [`CheckCode`] from the user. + * + * [MSC4108]: https://github.com/matrix-org/matrix-spec-proposals/pull/4108 + */ + @Throws(HumanQrGrantLoginException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `generate`(`progressListener`: GrantGeneratedQrLoginProgressListener) { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_grantloginwithqrcodehandler_generate( + thisPtr, + FfiConverterTypeGrantGeneratedQrLoginProgressListener.lower(`progressListener`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + // lift function + { Unit }, + + // Error FFI converter + HumanQrGrantLoginException.ErrorHandler, ) } - /** - * The URL of the currently configured homeserver. - */override fun `url`(): kotlin.String { - return FfiConverterString.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_homeserverlogindetails_url( - it, _status) -} - } + * This method allows you to grant login with a scanned QR code. + * + * The new device needs to display the QR code which this device can + * scan, call this method and handle its progress updates to grant the + * login. + * + * This method uses the login mechanism described in [MSC4108]. As such, + * it requires OAuth 2.0 support. + * + * For the reverse flow where this device generates the QR code for the + * existing device to scan, use [`GrantLoginWithQrCodeHandler::generate`]. + * + * # Arguments + * + * * `qr_code_data` - The [`QrCodeData`] scanned from the QR code. + * * `progress_listener` - A progress listener that must also be used to + * transfer the [`CheckCode`] to the new device. + * + * [MSC4108]: https://github.com/matrix-org/matrix-spec-proposals/pull/4108 + */ + @Throws(HumanQrGrantLoginException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `scan`(`qrCodeData`: QrCodeData, `progressListener`: GrantQrLoginProgressListener) { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_grantloginwithqrcodehandler_scan( + thisPtr, + FfiConverterTypeQrCodeData.lower(`qrCodeData`),FfiConverterTypeGrantQrLoginProgressListener.lower(`progressListener`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + // lift function + { Unit }, + + // Error FFI converter + HumanQrGrantLoginException.ErrorHandler, ) } - @@ -11475,25 +12586,25 @@ open class HomeserverLoginDetails: Disposable, AutoCloseable, HomeserverLoginDet /** * @suppress */ -public object FfiConverterTypeHomeserverLoginDetails: FfiConverter { +public object FfiConverterTypeGrantLoginWithQrCodeHandler: FfiConverter { - override fun lower(value: HomeserverLoginDetails): Pointer { + override fun lower(value: GrantLoginWithQrCodeHandler): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): HomeserverLoginDetails { - return HomeserverLoginDetails(value) + override fun lift(value: Pointer): GrantLoginWithQrCodeHandler { + return GrantLoginWithQrCodeHandler(value) } - override fun read(buf: ByteBuffer): HomeserverLoginDetails { + override fun read(buf: ByteBuffer): GrantLoginWithQrCodeHandler { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: HomeserverLoginDetails) = 8UL + override fun allocationSize(value: GrantLoginWithQrCodeHandler) = 8UL - override fun write(value: HomeserverLoginDetails, buf: ByteBuffer) { + override fun write(value: GrantLoginWithQrCodeHandler, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -11599,31 +12710,43 @@ public object FfiConverterTypeHomeserverLoginDetails: FfiConverter /** - * This method starts the identity reset process and - * will go through the following steps: - * - * 1. Disable backing up room keys and delete the active backup - * 2. Disable recovery and delete secret storage - * 3. Go through the cross-signing key reset flow - * 4. Finally, re-enable key backups only if they were enabled before + * Whether the current homeserver supports login using OIDC. */ - suspend fun `reset`(`auth`: AuthData?) + fun `supportsOidcLogin`(): kotlin.Boolean + + /** + * Whether the current homeserver supports the password login flow. + */ + fun `supportsPasswordLogin`(): kotlin.Boolean + + /** + * Whether the current homeserver supports login using legacy SSO. + */ + fun `supportsSsoLogin`(): kotlin.Boolean + + /** + * The URL of the currently configured homeserver. + */ + fun `url`(): kotlin.String companion object } -open class IdentityResetHandle: Disposable, AutoCloseable, IdentityResetHandleInterface +open class HomeserverLoginDetails: Disposable, AutoCloseable, HomeserverLoginDetailsInterface { constructor(pointer: Pointer) { @@ -11693,7 +12816,7 @@ open class IdentityResetHandle: Disposable, AutoCloseable, IdentityResetHandleIn override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_identityresethandle(ptr, status) + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_homeserverlogindetails(ptr, status) } } } @@ -11701,19 +12824,18 @@ open class IdentityResetHandle: Disposable, AutoCloseable, IdentityResetHandleIn fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_identityresethandle(pointer!!, status) + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_homeserverlogindetails(pointer!!, status) } } /** - * Get the underlying [`CrossSigningResetAuthType`] this identity reset - * process is using. - */override fun `authType`(): CrossSigningResetAuthType { - return FfiConverterTypeCrossSigningResetAuthType.lift( + * The sliding sync version. + */override fun `slidingSyncVersion`(): SlidingSyncVersion { + return FfiConverterTypeSlidingSyncVersion.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_identityresethandle_auth_type( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_homeserverlogindetails_sliding_sync_version( it, _status) } } @@ -11722,56 +12844,80 @@ open class IdentityResetHandle: Disposable, AutoCloseable, IdentityResetHandleIn - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `cancel`() { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_identityresethandle_cancel( - thisPtr, - - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, - // lift function - { Unit }, - - // Error FFI converter - UniffiNullRustCallStatusErrorHandler, + /** + * The prompts advertised by the authentication issuer for use in the login + * URL. + */override fun `supportedOidcPrompts`(): List { + return FfiConverterSequenceTypeOidcPrompt.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_homeserverlogindetails_supported_oidc_prompts( + it, _status) +} + } ) } + /** - * This method starts the identity reset process and - * will go through the following steps: - * - * 1. Disable backing up room keys and delete the active backup - * 2. Disable recovery and delete secret storage - * 3. Go through the cross-signing key reset flow - * 4. Finally, re-enable key backups only if they were enabled before - */ - @Throws(ClientException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `reset`(`auth`: AuthData?) { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_identityresethandle_reset( - thisPtr, - FfiConverterOptionalTypeAuthData.lower(`auth`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, - // lift function - { Unit }, - - // Error FFI converter - ClientException.ErrorHandler, + * Whether the current homeserver supports login using OIDC. + */override fun `supportsOidcLogin`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_homeserverlogindetails_supports_oidc_login( + it, _status) +} + } + ) + } + + + + /** + * Whether the current homeserver supports the password login flow. + */override fun `supportsPasswordLogin`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_homeserverlogindetails_supports_password_login( + it, _status) +} + } ) } + + + + /** + * Whether the current homeserver supports login using legacy SSO. + */override fun `supportsSsoLogin`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_homeserverlogindetails_supports_sso_login( + it, _status) +} + } + ) + } + + + + /** + * The URL of the currently configured homeserver. + */override fun `url`(): kotlin.String { + return FfiConverterString.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_homeserverlogindetails_url( + it, _status) +} + } + ) + } + @@ -11784,25 +12930,25 @@ open class IdentityResetHandle: Disposable, AutoCloseable, IdentityResetHandleIn /** * @suppress */ -public object FfiConverterTypeIdentityResetHandle: FfiConverter { +public object FfiConverterTypeHomeserverLoginDetails: FfiConverter { - override fun lower(value: IdentityResetHandle): Pointer { + override fun lower(value: HomeserverLoginDetails): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): IdentityResetHandle { - return IdentityResetHandle(value) + override fun lift(value: Pointer): HomeserverLoginDetails { + return HomeserverLoginDetails(value) } - override fun read(buf: ByteBuffer): IdentityResetHandle { + override fun read(buf: ByteBuffer): HomeserverLoginDetails { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: IdentityResetHandle) = 8UL + override fun allocationSize(value: HomeserverLoginDetails) = 8UL - override fun write(value: IdentityResetHandle, buf: ByteBuffer) { + override fun write(value: HomeserverLoginDetails, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -11908,16 +13054,31 @@ public object FfiConverterTypeIdentityResetHandle: FfiConverter uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_inreplytodetails(ptr, status) + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_identityresethandle(ptr, status) } } } @@ -11995,15 +13156,19 @@ open class InReplyToDetails: Disposable, AutoCloseable, InReplyToDetailsInterfac fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_inreplytodetails(pointer!!, status) + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_identityresethandle(pointer!!, status) } } - override fun `event`(): EmbeddedEventDetails { - return FfiConverterTypeEmbeddedEventDetails.lift( + + /** + * Get the underlying [`CrossSigningResetAuthType`] this identity reset + * process is using. + */override fun `authType`(): CrossSigningResetAuthType { + return FfiConverterTypeCrossSigningResetAuthType.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_inreplytodetails_event( + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_identityresethandle_auth_type( it, _status) } } @@ -12011,17 +13176,57 @@ open class InReplyToDetails: Disposable, AutoCloseable, InReplyToDetailsInterfac } - override fun `eventId`(): kotlin.String { - return FfiConverterString.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_inreplytodetails_event_id( - it, _status) -} - } + + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `cancel`() { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_identityresethandle_cancel( + thisPtr, + + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + // lift function + { Unit }, + + // Error FFI converter + UniffiNullRustCallStatusErrorHandler, ) } + + /** + * This method starts the identity reset process and + * will go through the following steps: + * + * 1. Disable backing up room keys and delete the active backup + * 2. Disable recovery and delete secret storage + * 3. Go through the cross-signing key reset flow + * 4. Finally, re-enable key backups only if they were enabled before + */ + @Throws(ClientException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `reset`(`auth`: AuthData?) { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_identityresethandle_reset( + thisPtr, + FfiConverterOptionalTypeAuthData.lower(`auth`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + // lift function + { Unit }, + + // Error FFI converter + ClientException.ErrorHandler, + ) + } @@ -12034,25 +13239,25 @@ open class InReplyToDetails: Disposable, AutoCloseable, InReplyToDetailsInterfac /** * @suppress */ -public object FfiConverterTypeInReplyToDetails: FfiConverter { +public object FfiConverterTypeIdentityResetHandle: FfiConverter { - override fun lower(value: InReplyToDetails): Pointer { + override fun lower(value: IdentityResetHandle): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): InReplyToDetails { - return InReplyToDetails(value) + override fun lift(value: Pointer): IdentityResetHandle { + return IdentityResetHandle(value) } - override fun read(buf: ByteBuffer): InReplyToDetails { + override fun read(buf: ByteBuffer): IdentityResetHandle { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: InReplyToDetails) = 8UL + override fun allocationSize(value: IdentityResetHandle) = 8UL - override fun write(value: InReplyToDetails, buf: ByteBuffer) { + override fun write(value: IdentityResetHandle, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -12158,43 +13363,293 @@ public object FfiConverterTypeInReplyToDetails: FfiConverter callWithPointer(block: (ptr: Pointer) -> R): R { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + do { + val c = this.callCounter.get() + if (c == 0L) { + throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed") + } + if (c == Long.MAX_VALUE) { + throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow") + } + } while (! this.callCounter.compareAndSet(c, c + 1L)) + // Now we can safely do the method call without the pointer being freed concurrently. + try { + return block(this.uniffiClonePointer()) + } finally { + // This decrement always matches the increment we performed above. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + // Use a static inner class instead of a closure so as not to accidentally + // capture `this` as part of the cleanable's action. + private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_inreplytodetails(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_inreplytodetails(pointer!!, status) + } + } + + override fun `event`(): EmbeddedEventDetails { + return FfiConverterTypeEmbeddedEventDetails.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_inreplytodetails_event( + it, _status) +} + } + ) + } + + + override fun `eventId`(): kotlin.String { + return FfiConverterString.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_inreplytodetails_event_id( + it, _status) +} + } + ) + } + + + + + + + companion object + +} + +/** + * @suppress + */ +public object FfiConverterTypeInReplyToDetails: FfiConverter { + + override fun lower(value: InReplyToDetails): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): InReplyToDetails { + return InReplyToDetails(value) + } + + override fun read(buf: ByteBuffer): InReplyToDetails { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) + } + + override fun allocationSize(value: InReplyToDetails) = 8UL + + override fun write(value: InReplyToDetails, buf: ByteBuffer) { + // The Rust code always expects pointers written as 8 bytes, + // and will fail to compile if they don't fit. + buf.putLong(Pointer.nativeValue(lower(value))) + } +} + + +// This template implements a class for working with a Rust struct via a Pointer/Arc +// to the live Rust struct on the other side of the FFI. +// +// Each instance implements core operations for working with the Rust `Arc` and the +// Kotlin Pointer to work with the live Rust struct on the other side of the FFI. +// +// There's some subtlety here, because we have to be careful not to operate on a Rust +// struct after it has been dropped, and because we must expose a public API for freeing +// theq Kotlin wrapper object in lieu of reliable finalizers. The core requirements are: +// +// * Each instance holds an opaque pointer to the underlying Rust struct. +// Method calls need to read this pointer from the object's state and pass it in to +// the Rust FFI. +// +// * When an instance is no longer needed, its pointer should be passed to a +// special destructor function provided by the Rust FFI, which will drop the +// underlying Rust struct. +// +// * Given an instance, calling code is expected to call the special +// `destroy` method in order to free it after use, either by calling it explicitly +// or by using a higher-level helper like the `use` method. Failing to do so risks +// leaking the underlying Rust struct. +// +// * We can't assume that calling code will do the right thing, and must be prepared +// to handle Kotlin method calls executing concurrently with or even after a call to +// `destroy`, and to handle multiple (possibly concurrent!) calls to `destroy`. +// +// * We must never allow Rust code to operate on the underlying Rust struct after +// the destructor has been called, and must never call the destructor more than once. +// Doing so may trigger memory unsafety. +// +// * To mitigate many of the risks of leaking memory and use-after-free unsafety, a `Cleaner` +// is implemented to call the destructor when the Kotlin object becomes unreachable. +// This is done in a background thread. This is not a panacea, and client code should be aware that +// 1. the thread may starve if some there are objects that have poorly performing +// `drop` methods or do significant work in their `drop` methods. +// 2. the thread is shared across the whole library. This can be tuned by using `android_cleaner = true`, +// or `android = true` in the [`kotlin` section of the `uniffi.toml` file](https://mozilla.github.io/uniffi-rs/kotlin/configuration.html). +// +// If we try to implement this with mutual exclusion on access to the pointer, there is the +// possibility of a race between a method call and a concurrent call to `destroy`: +// +// * Thread A starts a method call, reads the value of the pointer, but is interrupted +// before it can pass the pointer over the FFI to Rust. +// * Thread B calls `destroy` and frees the underlying Rust struct. +// * Thread A resumes, passing the already-read pointer value to Rust and triggering +// a use-after-free. +// +// One possible solution would be to use a `ReadWriteLock`, with each method call taking +// a read lock (and thus allowed to run concurrently) and the special `destroy` method +// taking a write lock (and thus blocking on live method calls). However, we aim not to +// generate methods with any hidden blocking semantics, and a `destroy` method that might +// block if called incorrectly seems to meet that bar. +// +// So, we achieve our goals by giving each instance an associated `AtomicLong` counter to track +// the number of in-flight method calls, and an `AtomicBoolean` flag to indicate whether `destroy` +// has been called. These are updated according to the following rules: +// +// * The initial value of the counter is 1, indicating a live object with no in-flight calls. +// The initial value for the flag is false. +// +// * At the start of each method call, we atomically check the counter. +// If it is 0 then the underlying Rust struct has already been destroyed and the call is aborted. +// If it is nonzero them we atomically increment it by 1 and proceed with the method call. +// +// * At the end of each method call, we atomically decrement and check the counter. +// If it has reached zero then we destroy the underlying Rust struct. +// +// * When `destroy` is called, we atomically flip the flag from false to true. +// If the flag was already true we silently fail. +// Otherwise we atomically decrement and check the counter. +// If it has reached zero then we destroy the underlying Rust struct. +// +// Astute readers may observe that this all sounds very similar to the way that Rust's `Arc` works, +// and indeed it is, with the addition of a flag to guard against multiple calls to `destroy`. +// +// The overall effect is that the underlying Rust struct is destroyed only when `destroy` has been +// called *and* all in-flight method calls have completed, avoiding violating any of the expectations +// of the underlying Rust code. +// +// This makes a cleaner a better alternative to _not_ calling `destroy()` as +// and when the object is finished with, but the abstraction is not perfect: if the Rust object's `drop` +// method is slow, and/or there are many objects to cleanup, and it's on a low end Android device, then the cleaner +// thread may be starved, and the app will leak memory. +// +// In this case, `destroy`ing manually may be a better solution. +// +// The cleaner can live side by side with the manual calling of `destroy`. In the order of responsiveness, uniffi objects +// with Rust peers are reclaimed: +// +// 1. By calling the `destroy` method of the object, which calls `rustObject.free()`. If that doesn't happen: +// 2. When the object becomes unreachable, AND the Cleaner thread gets to call `rustObject.free()`. If the thread is starved then: +// 3. The memory is reclaimed when the process terminates. +// +// [1] https://stackoverflow.com/questions/24376768/can-java-finalize-an-object-when-it-is-still-in-scope/24380219 +// + + +/** + * A set of actions to perform for a knock request. + */ +public interface KnockRequestActionsInterface { + + /** + * Accepts the knock request by inviting the user to the room. + */ + suspend fun `accept`() + + /** + * Declines the knock request by kicking the user from the room with an + * optional reason. + */ + suspend fun `decline`(`reason`: kotlin.String?) + + /** + * Declines the knock request by banning the user from the room with an + * optional reason. + */ + suspend fun `declineAndBan`(`reason`: kotlin.String?) + + /** + * Marks the knock request as 'seen'. + * + * **IMPORTANT**: this won't update the current reference to this request, + * a new one with the updated value should be emitted instead. + */ + suspend fun `markAsSeen`() + + companion object +} + +/** + * A set of actions to perform for a knock request. + */ +open class KnockRequestActions: Disposable, AutoCloseable, KnockRequestActionsInterface { constructor(pointer: Pointer) { @@ -12821,26 +14276,38 @@ public object FfiConverterTypeLazyTimelineItemProvider: FfiConverter) - fun `persist`(`path`: kotlin.String): kotlin.Boolean + /** + * A list of rooms to be left which next to normal [`SpaceRoom`] data also + * include leave specific information. + */ + fun `rooms`(): List companion object } /** - * A file handle that takes ownership of a media file on disk. When the handle - * is dropped, the file will be removed from the disk. + * The `LeaveSpaceHandle` processes rooms to be left in the order they were + * provided by the [`SpaceService`] and annotates them with extra data to + * inform the leave process e.g. if the current user is the last room admin. + * + * Once the upstream client decides what rooms should actually be left, the + * handle provides a method to execute that too. */ -open class MediaFileHandle: Disposable, AutoCloseable, MediaFileHandleInterface +open class LeaveSpaceHandle: Disposable, AutoCloseable, LeaveSpaceHandleInterface { constructor(pointer: Pointer) { @@ -12910,7 +14377,7 @@ open class MediaFileHandle: Disposable, AutoCloseable, MediaFileHandleInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_mediafilehandle(ptr, status) + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_leavespacehandle(ptr, status) } } } @@ -12918,33 +14385,45 @@ open class MediaFileHandle: Disposable, AutoCloseable, MediaFileHandleInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_mediafilehandle(pointer!!, status) + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_leavespacehandle(pointer!!, status) } } /** - * Get the media file's path. + * Bulk leave the given rooms. Stops when encountering an error. */ - @Throws(ClientException::class)override fun `path`(): kotlin.String { - return FfiConverterString.lift( - callWithPointer { - uniffiRustCallWithError(ClientException) { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_mediafilehandle_path( - it, _status) -} - } + @Throws(ClientException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `leave`(`roomIds`: List) { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_leavespacehandle_leave( + thisPtr, + FfiConverterSequenceString.lower(`roomIds`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + // lift function + { Unit }, + + // Error FFI converter + ClientException.ErrorHandler, ) } - - @Throws(ClientException::class)override fun `persist`(`path`: kotlin.String): kotlin.Boolean { - return FfiConverterBoolean.lift( + /** + * A list of rooms to be left which next to normal [`SpaceRoom`] data also + * include leave specific information. + */override fun `rooms`(): List { + return FfiConverterSequenceTypeLeaveSpaceRoom.lift( callWithPointer { - uniffiRustCallWithError(ClientException) { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_mediafilehandle_persist( - it, FfiConverterString.lower(`path`),_status) + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_leavespacehandle_rooms( + it, _status) } } ) @@ -12962,25 +14441,25 @@ open class MediaFileHandle: Disposable, AutoCloseable, MediaFileHandleInterface /** * @suppress */ -public object FfiConverterTypeMediaFileHandle: FfiConverter { +public object FfiConverterTypeLeaveSpaceHandle: FfiConverter { - override fun lower(value: MediaFileHandle): Pointer { + override fun lower(value: LeaveSpaceHandle): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): MediaFileHandle { - return MediaFileHandle(value) + override fun lift(value: Pointer): LeaveSpaceHandle { + return LeaveSpaceHandle(value) } - override fun read(buf: ByteBuffer): MediaFileHandle { + override fun read(buf: ByteBuffer): LeaveSpaceHandle { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: MediaFileHandle) = 8UL + override fun allocationSize(value: LeaveSpaceHandle) = 8UL - override fun write(value: MediaFileHandle, buf: ByteBuffer) { + override fun write(value: LeaveSpaceHandle, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -13086,16 +14565,66 @@ public object FfiConverterTypeMediaFileHandle: FfiConverter uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_mediasource(ptr, status) + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_loginwithqrcodehandler(ptr, status) } } } @@ -13173,87 +14702,128 @@ open class MediaSource: Disposable, AutoCloseable, MediaSourceInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_mediasource(pointer!!, status) + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_loginwithqrcodehandler(pointer!!, status) } } - override fun `toJson`(): kotlin.String { - return FfiConverterString.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_mediasource_to_json( - it, _status) -} - } - ) - } - - override fun `url`(): kotlin.String { - return FfiConverterString.lift( - callWithPointer { - uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_mediasource_url( - it, _status) -} - } + /** + * This method allows you to log in by generating a QR code. + * + * This device needs to call this method and handle its progress updates to + * generate a QR code which the existing device can scan and grant the + * log in. + * + * This method uses the login mechanism described in [MSC4108]. As such, + * it requires OAuth 2.0 support. + * + * For the reverse flow where the existing device generates the QR code + * for this device to scan, use [`LoginWithQrCodeHandler::scan`]. + * + * # Arguments + * + * * `progress_listener` - A progress listener that must also be used to + * obtain the [`QrCodeData`] and collect the [`CheckCode`] from the user. + * + * [MSC4108]: https://github.com/matrix-org/matrix-spec-proposals/pull/4108 + */ + @Throws(HumanQrLoginException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `generate`(`progressListener`: GeneratedQrLoginProgressListener) { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_loginwithqrcodehandler_generate( + thisPtr, + FfiConverterTypeGeneratedQrLoginProgressListener.lower(`progressListener`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + // lift function + { Unit }, + + // Error FFI converter + HumanQrLoginException.ErrorHandler, ) } - - - - companion object { + /** + * This method allows you to log in with a scanned QR code. + * + * The existing device needs to display the QR code which this device can + * scan, call this method and handle its progress updates to log in. + * + * For the login to succeed, the [`Client`] associated with the + * [`LoginWithQrCodeHandler`] must have been built with + * [`QrCodeData::server_name`] as the server name. + * + * This method uses the login mechanism described in [MSC4108]. As such, + * it requires OAuth 2.0 support. + * + * For the reverse flow where this device generates the QR code for the + * existing device to scan, use [`LoginWithQrCodeHandler::generate`]. + * + * # Arguments + * + * * `qr_code_data` - The [`QrCodeData`] scanned from the QR code. + * * `progress_listener` - A progress listener that must also be used to + * transfer the [`CheckCode`] to the existing device. + * + * [MSC4108]: https://github.com/matrix-org/matrix-spec-proposals/pull/4108 + */ + @Throws(HumanQrLoginException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `scan`(`qrCodeData`: QrCodeData, `progressListener`: QrLoginProgressListener) { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_loginwithqrcodehandler_scan( + thisPtr, + FfiConverterTypeQrCodeData.lower(`qrCodeData`),FfiConverterTypeQrLoginProgressListener.lower(`progressListener`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + // lift function + { Unit }, - @Throws(ClientException::class) fun `fromJson`(`json`: kotlin.String): MediaSource { - return FfiConverterTypeMediaSource.lift( - uniffiRustCallWithError(ClientException) { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_constructor_mediasource_from_json( - FfiConverterString.lower(`json`),_status) -} + // Error FFI converter + HumanQrLoginException.ErrorHandler, ) } - - - @Throws(ClientException::class) fun `fromUrl`(`url`: kotlin.String): MediaSource { - return FfiConverterTypeMediaSource.lift( - uniffiRustCallWithError(ClientException) { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_constructor_mediasource_from_url( - FfiConverterString.lower(`url`),_status) -} - ) - } - - } + + + companion object } /** * @suppress */ -public object FfiConverterTypeMediaSource: FfiConverter { +public object FfiConverterTypeLoginWithQrCodeHandler: FfiConverter { - override fun lower(value: MediaSource): Pointer { + override fun lower(value: LoginWithQrCodeHandler): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): MediaSource { - return MediaSource(value) + override fun lift(value: Pointer): LoginWithQrCodeHandler { + return LoginWithQrCodeHandler(value) } - override fun read(buf: ByteBuffer): MediaSource { + override fun read(buf: ByteBuffer): LoginWithQrCodeHandler { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: MediaSource) = 8UL + override fun allocationSize(value: LoginWithQrCodeHandler) = 8UL - override fun write(value: MediaSource, buf: ByteBuffer) { + override fun write(value: LoginWithQrCodeHandler, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -13359,43 +14929,27 @@ public object FfiConverterTypeMediaSource: FfiConverter { // -public interface NotificationClientInterface { - - /** - * Fetches the content of a notification. - * - * This will first try to get the notification using a short-lived sliding - * sync, and if the sliding-sync can't find the event, then it'll use a - * `/context` query to find the event with associated member information. - * - * An error result means that we couldn't resolve the notification; in that - * case, a dummy notification may be displayed instead. - */ - suspend fun `getNotification`(`roomId`: kotlin.String, `eventId`: kotlin.String): NotificationStatus +/** + * A file handle that takes ownership of a media file on disk. When the handle + * is dropped, the file will be removed from the disk. + */ +public interface MediaFileHandleInterface { /** - * Get several notification items in a single batch. - * - * Returns an error if the flow failed when preparing to fetch the - * notifications, and a [`HashMap`] containing either a - * [`BatchNotificationResult`], that indicates if the notification was - * successfully fetched (in which case, it's a [`NotificationStatus`]), or - * an error message if it couldn't be fetched. + * Get the media file's path. */ - suspend fun `getNotifications`(`requests`: List): Map + fun `path`(): kotlin.String - /** - * Fetches a room by its ID using the in-memory state store backed client. - * - * Useful to retrieve room information after running the limited - * notification client sliding sync loop. - */ - fun `getRoom`(`roomId`: kotlin.String): Room? + fun `persist`(`path`: kotlin.String): kotlin.Boolean companion object } -open class NotificationClient: Disposable, AutoCloseable, NotificationClientInterface +/** + * A file handle that takes ownership of a media file on disk. When the handle + * is dropped, the file will be removed from the disk. + */ +open class MediaFileHandle: Disposable, AutoCloseable, MediaFileHandleInterface { constructor(pointer: Pointer) { @@ -13465,7 +15019,7 @@ open class NotificationClient: Disposable, AutoCloseable, NotificationClientInte override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_notificationclient(ptr, status) + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_mediafilehandle(ptr, status) } } } @@ -13473,84 +15027,33 @@ open class NotificationClient: Disposable, AutoCloseable, NotificationClientInte fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_notificationclient(pointer!!, status) + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_mediafilehandle(pointer!!, status) } } /** - * Fetches the content of a notification. - * - * This will first try to get the notification using a short-lived sliding - * sync, and if the sliding-sync can't find the event, then it'll use a - * `/context` query to find the event with associated member information. - * - * An error result means that we couldn't resolve the notification; in that - * case, a dummy notification may be displayed instead. + * Get the media file's path. */ - @Throws(ClientException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `getNotification`(`roomId`: kotlin.String, `eventId`: kotlin.String) : NotificationStatus { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationclient_get_notification( - thisPtr, - FfiConverterString.lower(`roomId`),FfiConverterString.lower(`eventId`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterTypeNotificationStatus.lift(it) }, - // Error FFI converter - ClientException.ErrorHandler, - ) + @Throws(ClientException::class)override fun `path`(): kotlin.String { + return FfiConverterString.lift( + callWithPointer { + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_mediafilehandle_path( + it, _status) +} } - - - /** - * Get several notification items in a single batch. - * - * Returns an error if the flow failed when preparing to fetch the - * notifications, and a [`HashMap`] containing either a - * [`BatchNotificationResult`], that indicates if the notification was - * successfully fetched (in which case, it's a [`NotificationStatus`]), or - * an error message if it couldn't be fetched. - */ - @Throws(ClientException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `getNotifications`(`requests`: List) : Map { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationclient_get_notifications( - thisPtr, - FfiConverterSequenceTypeNotificationItemsRequest.lower(`requests`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterMapStringTypeBatchNotificationResult.lift(it) }, - // Error FFI converter - ClientException.ErrorHandler, ) } + - /** - * Fetches a room by its ID using the in-memory state store backed client. - * - * Useful to retrieve room information after running the limited - * notification client sliding sync loop. - */ - @Throws(ClientException::class)override fun `getRoom`(`roomId`: kotlin.String): Room? { - return FfiConverterOptionalTypeRoom.lift( + @Throws(ClientException::class)override fun `persist`(`path`: kotlin.String): kotlin.Boolean { + return FfiConverterBoolean.lift( callWithPointer { uniffiRustCallWithError(ClientException) { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationclient_get_room( - it, FfiConverterString.lower(`roomId`),_status) + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_mediafilehandle_persist( + it, FfiConverterString.lower(`path`),_status) } } ) @@ -13568,25 +15071,631 @@ open class NotificationClient: Disposable, AutoCloseable, NotificationClientInte /** * @suppress */ -public object FfiConverterTypeNotificationClient: FfiConverter { +public object FfiConverterTypeMediaFileHandle: FfiConverter { - override fun lower(value: NotificationClient): Pointer { + override fun lower(value: MediaFileHandle): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): NotificationClient { - return NotificationClient(value) + override fun lift(value: Pointer): MediaFileHandle { + return MediaFileHandle(value) } - override fun read(buf: ByteBuffer): NotificationClient { + override fun read(buf: ByteBuffer): MediaFileHandle { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: NotificationClient) = 8UL + override fun allocationSize(value: MediaFileHandle) = 8UL - override fun write(value: NotificationClient, buf: ByteBuffer) { + override fun write(value: MediaFileHandle, buf: ByteBuffer) { + // The Rust code always expects pointers written as 8 bytes, + // and will fail to compile if they don't fit. + buf.putLong(Pointer.nativeValue(lower(value))) + } +} + + +// This template implements a class for working with a Rust struct via a Pointer/Arc +// to the live Rust struct on the other side of the FFI. +// +// Each instance implements core operations for working with the Rust `Arc` and the +// Kotlin Pointer to work with the live Rust struct on the other side of the FFI. +// +// There's some subtlety here, because we have to be careful not to operate on a Rust +// struct after it has been dropped, and because we must expose a public API for freeing +// theq Kotlin wrapper object in lieu of reliable finalizers. The core requirements are: +// +// * Each instance holds an opaque pointer to the underlying Rust struct. +// Method calls need to read this pointer from the object's state and pass it in to +// the Rust FFI. +// +// * When an instance is no longer needed, its pointer should be passed to a +// special destructor function provided by the Rust FFI, which will drop the +// underlying Rust struct. +// +// * Given an instance, calling code is expected to call the special +// `destroy` method in order to free it after use, either by calling it explicitly +// or by using a higher-level helper like the `use` method. Failing to do so risks +// leaking the underlying Rust struct. +// +// * We can't assume that calling code will do the right thing, and must be prepared +// to handle Kotlin method calls executing concurrently with or even after a call to +// `destroy`, and to handle multiple (possibly concurrent!) calls to `destroy`. +// +// * We must never allow Rust code to operate on the underlying Rust struct after +// the destructor has been called, and must never call the destructor more than once. +// Doing so may trigger memory unsafety. +// +// * To mitigate many of the risks of leaking memory and use-after-free unsafety, a `Cleaner` +// is implemented to call the destructor when the Kotlin object becomes unreachable. +// This is done in a background thread. This is not a panacea, and client code should be aware that +// 1. the thread may starve if some there are objects that have poorly performing +// `drop` methods or do significant work in their `drop` methods. +// 2. the thread is shared across the whole library. This can be tuned by using `android_cleaner = true`, +// or `android = true` in the [`kotlin` section of the `uniffi.toml` file](https://mozilla.github.io/uniffi-rs/kotlin/configuration.html). +// +// If we try to implement this with mutual exclusion on access to the pointer, there is the +// possibility of a race between a method call and a concurrent call to `destroy`: +// +// * Thread A starts a method call, reads the value of the pointer, but is interrupted +// before it can pass the pointer over the FFI to Rust. +// * Thread B calls `destroy` and frees the underlying Rust struct. +// * Thread A resumes, passing the already-read pointer value to Rust and triggering +// a use-after-free. +// +// One possible solution would be to use a `ReadWriteLock`, with each method call taking +// a read lock (and thus allowed to run concurrently) and the special `destroy` method +// taking a write lock (and thus blocking on live method calls). However, we aim not to +// generate methods with any hidden blocking semantics, and a `destroy` method that might +// block if called incorrectly seems to meet that bar. +// +// So, we achieve our goals by giving each instance an associated `AtomicLong` counter to track +// the number of in-flight method calls, and an `AtomicBoolean` flag to indicate whether `destroy` +// has been called. These are updated according to the following rules: +// +// * The initial value of the counter is 1, indicating a live object with no in-flight calls. +// The initial value for the flag is false. +// +// * At the start of each method call, we atomically check the counter. +// If it is 0 then the underlying Rust struct has already been destroyed and the call is aborted. +// If it is nonzero them we atomically increment it by 1 and proceed with the method call. +// +// * At the end of each method call, we atomically decrement and check the counter. +// If it has reached zero then we destroy the underlying Rust struct. +// +// * When `destroy` is called, we atomically flip the flag from false to true. +// If the flag was already true we silently fail. +// Otherwise we atomically decrement and check the counter. +// If it has reached zero then we destroy the underlying Rust struct. +// +// Astute readers may observe that this all sounds very similar to the way that Rust's `Arc` works, +// and indeed it is, with the addition of a flag to guard against multiple calls to `destroy`. +// +// The overall effect is that the underlying Rust struct is destroyed only when `destroy` has been +// called *and* all in-flight method calls have completed, avoiding violating any of the expectations +// of the underlying Rust code. +// +// This makes a cleaner a better alternative to _not_ calling `destroy()` as +// and when the object is finished with, but the abstraction is not perfect: if the Rust object's `drop` +// method is slow, and/or there are many objects to cleanup, and it's on a low end Android device, then the cleaner +// thread may be starved, and the app will leak memory. +// +// In this case, `destroy`ing manually may be a better solution. +// +// The cleaner can live side by side with the manual calling of `destroy`. In the order of responsiveness, uniffi objects +// with Rust peers are reclaimed: +// +// 1. By calling the `destroy` method of the object, which calls `rustObject.free()`. If that doesn't happen: +// 2. When the object becomes unreachable, AND the Cleaner thread gets to call `rustObject.free()`. If the thread is starved then: +// 3. The memory is reclaimed when the process terminates. +// +// [1] https://stackoverflow.com/questions/24376768/can-java-finalize-an-object-when-it-is-still-in-scope/24380219 +// + + +public interface MediaSourceInterface { + + fun `toJson`(): kotlin.String + + fun `url`(): kotlin.String + + companion object +} + +open class MediaSource: Disposable, AutoCloseable, MediaSourceInterface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + /** + * This constructor can be used to instantiate a fake object. Only used for tests. Any + * attempt to actually use an object constructed this way will fail as there is no + * connected Rust object. + */ + @Suppress("UNUSED_PARAMETER") + constructor(noPointer: NoPointer) { + this.pointer = null + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + protected val pointer: Pointer? + protected val cleanable: UniffiCleaner.Cleanable + + private val wasDestroyed = AtomicBoolean(false) + private val callCounter = AtomicLong(1) + + override fun destroy() { + // Only allow a single call to this method. + // TODO: maybe we should log a warning if called more than once? + if (this.wasDestroyed.compareAndSet(false, true)) { + // This decrement always matches the initial count of 1 given at creation time. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + @Synchronized + override fun close() { + this.destroy() + } + + internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + do { + val c = this.callCounter.get() + if (c == 0L) { + throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed") + } + if (c == Long.MAX_VALUE) { + throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow") + } + } while (! this.callCounter.compareAndSet(c, c + 1L)) + // Now we can safely do the method call without the pointer being freed concurrently. + try { + return block(this.uniffiClonePointer()) + } finally { + // This decrement always matches the increment we performed above. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + // Use a static inner class instead of a closure so as not to accidentally + // capture `this` as part of the cleanable's action. + private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_mediasource(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_mediasource(pointer!!, status) + } + } + + override fun `toJson`(): kotlin.String { + return FfiConverterString.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_mediasource_to_json( + it, _status) +} + } + ) + } + + + override fun `url`(): kotlin.String { + return FfiConverterString.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_mediasource_url( + it, _status) +} + } + ) + } + + + + + + companion object { + + @Throws(ClientException::class) fun `fromJson`(`json`: kotlin.String): MediaSource { + return FfiConverterTypeMediaSource.lift( + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_constructor_mediasource_from_json( + FfiConverterString.lower(`json`),_status) +} + ) + } + + + + @Throws(ClientException::class) fun `fromUrl`(`url`: kotlin.String): MediaSource { + return FfiConverterTypeMediaSource.lift( + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_constructor_mediasource_from_url( + FfiConverterString.lower(`url`),_status) +} + ) + } + + + + } + +} + +/** + * @suppress + */ +public object FfiConverterTypeMediaSource: FfiConverter { + + override fun lower(value: MediaSource): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): MediaSource { + return MediaSource(value) + } + + override fun read(buf: ByteBuffer): MediaSource { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) + } + + override fun allocationSize(value: MediaSource) = 8UL + + override fun write(value: MediaSource, buf: ByteBuffer) { + // The Rust code always expects pointers written as 8 bytes, + // and will fail to compile if they don't fit. + buf.putLong(Pointer.nativeValue(lower(value))) + } +} + + +// This template implements a class for working with a Rust struct via a Pointer/Arc +// to the live Rust struct on the other side of the FFI. +// +// Each instance implements core operations for working with the Rust `Arc` and the +// Kotlin Pointer to work with the live Rust struct on the other side of the FFI. +// +// There's some subtlety here, because we have to be careful not to operate on a Rust +// struct after it has been dropped, and because we must expose a public API for freeing +// theq Kotlin wrapper object in lieu of reliable finalizers. The core requirements are: +// +// * Each instance holds an opaque pointer to the underlying Rust struct. +// Method calls need to read this pointer from the object's state and pass it in to +// the Rust FFI. +// +// * When an instance is no longer needed, its pointer should be passed to a +// special destructor function provided by the Rust FFI, which will drop the +// underlying Rust struct. +// +// * Given an instance, calling code is expected to call the special +// `destroy` method in order to free it after use, either by calling it explicitly +// or by using a higher-level helper like the `use` method. Failing to do so risks +// leaking the underlying Rust struct. +// +// * We can't assume that calling code will do the right thing, and must be prepared +// to handle Kotlin method calls executing concurrently with or even after a call to +// `destroy`, and to handle multiple (possibly concurrent!) calls to `destroy`. +// +// * We must never allow Rust code to operate on the underlying Rust struct after +// the destructor has been called, and must never call the destructor more than once. +// Doing so may trigger memory unsafety. +// +// * To mitigate many of the risks of leaking memory and use-after-free unsafety, a `Cleaner` +// is implemented to call the destructor when the Kotlin object becomes unreachable. +// This is done in a background thread. This is not a panacea, and client code should be aware that +// 1. the thread may starve if some there are objects that have poorly performing +// `drop` methods or do significant work in their `drop` methods. +// 2. the thread is shared across the whole library. This can be tuned by using `android_cleaner = true`, +// or `android = true` in the [`kotlin` section of the `uniffi.toml` file](https://mozilla.github.io/uniffi-rs/kotlin/configuration.html). +// +// If we try to implement this with mutual exclusion on access to the pointer, there is the +// possibility of a race between a method call and a concurrent call to `destroy`: +// +// * Thread A starts a method call, reads the value of the pointer, but is interrupted +// before it can pass the pointer over the FFI to Rust. +// * Thread B calls `destroy` and frees the underlying Rust struct. +// * Thread A resumes, passing the already-read pointer value to Rust and triggering +// a use-after-free. +// +// One possible solution would be to use a `ReadWriteLock`, with each method call taking +// a read lock (and thus allowed to run concurrently) and the special `destroy` method +// taking a write lock (and thus blocking on live method calls). However, we aim not to +// generate methods with any hidden blocking semantics, and a `destroy` method that might +// block if called incorrectly seems to meet that bar. +// +// So, we achieve our goals by giving each instance an associated `AtomicLong` counter to track +// the number of in-flight method calls, and an `AtomicBoolean` flag to indicate whether `destroy` +// has been called. These are updated according to the following rules: +// +// * The initial value of the counter is 1, indicating a live object with no in-flight calls. +// The initial value for the flag is false. +// +// * At the start of each method call, we atomically check the counter. +// If it is 0 then the underlying Rust struct has already been destroyed and the call is aborted. +// If it is nonzero them we atomically increment it by 1 and proceed with the method call. +// +// * At the end of each method call, we atomically decrement and check the counter. +// If it has reached zero then we destroy the underlying Rust struct. +// +// * When `destroy` is called, we atomically flip the flag from false to true. +// If the flag was already true we silently fail. +// Otherwise we atomically decrement and check the counter. +// If it has reached zero then we destroy the underlying Rust struct. +// +// Astute readers may observe that this all sounds very similar to the way that Rust's `Arc` works, +// and indeed it is, with the addition of a flag to guard against multiple calls to `destroy`. +// +// The overall effect is that the underlying Rust struct is destroyed only when `destroy` has been +// called *and* all in-flight method calls have completed, avoiding violating any of the expectations +// of the underlying Rust code. +// +// This makes a cleaner a better alternative to _not_ calling `destroy()` as +// and when the object is finished with, but the abstraction is not perfect: if the Rust object's `drop` +// method is slow, and/or there are many objects to cleanup, and it's on a low end Android device, then the cleaner +// thread may be starved, and the app will leak memory. +// +// In this case, `destroy`ing manually may be a better solution. +// +// The cleaner can live side by side with the manual calling of `destroy`. In the order of responsiveness, uniffi objects +// with Rust peers are reclaimed: +// +// 1. By calling the `destroy` method of the object, which calls `rustObject.free()`. If that doesn't happen: +// 2. When the object becomes unreachable, AND the Cleaner thread gets to call `rustObject.free()`. If the thread is starved then: +// 3. The memory is reclaimed when the process terminates. +// +// [1] https://stackoverflow.com/questions/24376768/can-java-finalize-an-object-when-it-is-still-in-scope/24380219 +// + + +public interface NotificationClientInterface { + + /** + * Fetches the content of a notification. + * + * This will first try to get the notification using a short-lived sliding + * sync, and if the sliding-sync can't find the event, then it'll use a + * `/context` query to find the event with associated member information. + * + * An error result means that we couldn't resolve the notification; in that + * case, a dummy notification may be displayed instead. + */ + suspend fun `getNotification`(`roomId`: kotlin.String, `eventId`: kotlin.String): NotificationStatus + + /** + * Get several notification items in a single batch. + * + * Returns an error if the flow failed when preparing to fetch the + * notifications, and a [`HashMap`] containing either a + * [`BatchNotificationResult`], that indicates if the notification was + * successfully fetched (in which case, it's a [`NotificationStatus`]), or + * an error message if it couldn't be fetched. + */ + suspend fun `getNotifications`(`requests`: List): Map + + /** + * Fetches a room by its ID using the in-memory state store backed client. + * + * Useful to retrieve room information after running the limited + * notification client sliding sync loop. + */ + fun `getRoom`(`roomId`: kotlin.String): Room? + + companion object +} + +open class NotificationClient: Disposable, AutoCloseable, NotificationClientInterface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + /** + * This constructor can be used to instantiate a fake object. Only used for tests. Any + * attempt to actually use an object constructed this way will fail as there is no + * connected Rust object. + */ + @Suppress("UNUSED_PARAMETER") + constructor(noPointer: NoPointer) { + this.pointer = null + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + protected val pointer: Pointer? + protected val cleanable: UniffiCleaner.Cleanable + + private val wasDestroyed = AtomicBoolean(false) + private val callCounter = AtomicLong(1) + + override fun destroy() { + // Only allow a single call to this method. + // TODO: maybe we should log a warning if called more than once? + if (this.wasDestroyed.compareAndSet(false, true)) { + // This decrement always matches the initial count of 1 given at creation time. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + @Synchronized + override fun close() { + this.destroy() + } + + internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + do { + val c = this.callCounter.get() + if (c == 0L) { + throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed") + } + if (c == Long.MAX_VALUE) { + throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow") + } + } while (! this.callCounter.compareAndSet(c, c + 1L)) + // Now we can safely do the method call without the pointer being freed concurrently. + try { + return block(this.uniffiClonePointer()) + } finally { + // This decrement always matches the increment we performed above. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + // Use a static inner class instead of a closure so as not to accidentally + // capture `this` as part of the cleanable's action. + private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_notificationclient(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_notificationclient(pointer!!, status) + } + } + + + /** + * Fetches the content of a notification. + * + * This will first try to get the notification using a short-lived sliding + * sync, and if the sliding-sync can't find the event, then it'll use a + * `/context` query to find the event with associated member information. + * + * An error result means that we couldn't resolve the notification; in that + * case, a dummy notification may be displayed instead. + */ + @Throws(ClientException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `getNotification`(`roomId`: kotlin.String, `eventId`: kotlin.String) : NotificationStatus { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationclient_get_notification( + thisPtr, + FfiConverterString.lower(`roomId`),FfiConverterString.lower(`eventId`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterTypeNotificationStatus.lift(it) }, + // Error FFI converter + ClientException.ErrorHandler, + ) + } + + + /** + * Get several notification items in a single batch. + * + * Returns an error if the flow failed when preparing to fetch the + * notifications, and a [`HashMap`] containing either a + * [`BatchNotificationResult`], that indicates if the notification was + * successfully fetched (in which case, it's a [`NotificationStatus`]), or + * an error message if it couldn't be fetched. + */ + @Throws(ClientException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `getNotifications`(`requests`: List) : Map { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationclient_get_notifications( + thisPtr, + FfiConverterSequenceTypeNotificationItemsRequest.lower(`requests`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterMapStringTypeBatchNotificationResult.lift(it) }, + // Error FFI converter + ClientException.ErrorHandler, + ) + } + + + /** + * Fetches a room by its ID using the in-memory state store backed client. + * + * Useful to retrieve room information after running the limited + * notification client sliding sync loop. + */ + @Throws(ClientException::class)override fun `getRoom`(`roomId`: kotlin.String): Room? { + return FfiConverterOptionalTypeRoom.lift( + callWithPointer { + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationclient_get_room( + it, FfiConverterString.lower(`roomId`),_status) +} + } + ) + } + + + + + + + companion object + +} + +/** + * @suppress + */ +public object FfiConverterTypeNotificationClient: FfiConverter { + + override fun lower(value: NotificationClient): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): NotificationClient { + return NotificationClient(value) + } + + override fun read(buf: ByteBuffer): NotificationClient { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) + } + + override fun allocationSize(value: NotificationClient) = 8UL + + override fun write(value: NotificationClient, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -13727,6 +15836,11 @@ public interface NotificationSettingsInterface { */ suspend fun `getDefaultRoomNotificationMode`(`isEncrypted`: kotlin.Boolean, `isOneToOne`: kotlin.Boolean): RoomNotificationMode + /** + * Returns the raw push rules in JSON format. + */ + suspend fun `getRawPushRules`(): kotlin.String? + /** * Get the notification settings for a room. * @@ -14021,6 +16135,30 @@ open class NotificationSettings: Disposable, AutoCloseable, NotificationSettings } + /** + * Returns the raw push rules in JSON format. + */ + @Throws(ClientException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `getRawPushRules`() : kotlin.String? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_notificationsettings_get_raw_push_rules( + thisPtr, + + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalString.lift(it) }, + // Error FFI converter + ClientException.ErrorHandler, + ) + } + + /** * Get the notification settings for a room. * @@ -14897,6 +17035,16 @@ public interface RoomInterface { */ suspend fun `clearEventCacheStorage`() + /** + * Declines a call (and stop ringing). + * + * # Arguments + * + * * `rtc_notification_event_id` - the event id of the m.rtc.notification + * event. + */ + suspend fun `declineCall`(`rtcNotificationEventId`: kotlin.String) + /** * Forces the currently active room key, which is used to encrypt messages, * to be rotated. @@ -15061,6 +17209,25 @@ public interface RoomInterface { */ suspend fun `loadComposerDraft`(`threadRoot`: kotlin.String?): ComposerDraft? + /** + * Either loads the event associated with the `event_id` from the event + * cache or fetches it from the homeserver. + */ + suspend fun `loadOrFetchEvent`(`eventId`: kotlin.String): TimelineEvent + + /** + * Mark a room as fully read, by attaching a read receipt to the provided + * `event_id`. + * + * **Warning:** using this method is **NOT** recommended, as providing the + * latest event id can cause incorrect read receipts. This method won't + * check if sending the read receipt is necessary or valid. It should + * *only* be used when some constraint prevents you from instantiating a + * [`Timeline`]. For any other case use [`Timeline::mark_as_read`] + * instead. + */ + suspend fun `markAsFullyReadUnchecked`(`eventId`: kotlin.String) + /** * Mark a room as read, by attaching a read receipt on the latest event. * @@ -15273,6 +17440,15 @@ public interface RoomInterface { */ suspend fun `stopLiveLocationShare`() + /** + * Subscribes to call decline for a currently ringing call, using a + * `listener` to be notified when someone declines. + * + * Will error if `rtc_notification_event_id` is not a valid event id. + * Use the [`TaskHandle`] to cancel the subscription. + */ + fun `subscribeToCallDeclineEvents`(`rtcNotificationEventId`: kotlin.String, `listener`: CallDeclineListener): TaskHandle + suspend fun `subscribeToIdentityStatusChanges`(`listener`: IdentityStatusChangeListener): TaskHandle /** @@ -15296,6 +17472,15 @@ public interface RoomInterface { fun `subscribeToRoomInfoUpdates`(`listener`: RoomInfoListener): TaskHandle + /** + * Subscribe to all send queue updates in this room. + * + * The given listener will be immediately called with + * `RoomSendQueueUpdate::NewLocalEvent` for each local echo existing in + * the queue. + */ + suspend fun `subscribeToSendQueueUpdates`(`listener`: SendQueueListener): TaskHandle + fun `subscribeToTypingNotifications`(`listener`: TypingNotificationsListener): TaskHandle /** @@ -15636,6 +17821,36 @@ open class Room: Disposable, AutoCloseable, RoomInterface } + /** + * Declines a call (and stop ringing). + * + * # Arguments + * + * * `rtc_notification_event_id` - the event id of the m.rtc.notification + * event. + */ + @Throws(ClientException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `declineCall`(`rtcNotificationEventId`: kotlin.String) { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_decline_call( + thisPtr, + FfiConverterString.lower(`rtcNotificationEventId`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + // lift function + { Unit }, + + // Error FFI converter + ClientException.ErrorHandler, + ) + } + + /** * Forces the currently active room key, which is used to encrypt messages, * to be rotated. @@ -16277,6 +18492,64 @@ open class Room: Disposable, AutoCloseable, RoomInterface } + /** + * Either loads the event associated with the `event_id` from the event + * cache or fetches it from the homeserver. + */ + @Throws(ClientException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `loadOrFetchEvent`(`eventId`: kotlin.String) : TimelineEvent { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_load_or_fetch_event( + thisPtr, + FfiConverterString.lower(`eventId`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, + // lift function + { FfiConverterTypeTimelineEvent.lift(it) }, + // Error FFI converter + ClientException.ErrorHandler, + ) + } + + + /** + * Mark a room as fully read, by attaching a read receipt to the provided + * `event_id`. + * + * **Warning:** using this method is **NOT** recommended, as providing the + * latest event id can cause incorrect read receipts. This method won't + * check if sending the read receipt is necessary or valid. It should + * *only* be used when some constraint prevents you from instantiating a + * [`Timeline`]. For any other case use [`Timeline::mark_as_read`] + * instead. + */ + @Throws(ClientException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `markAsFullyReadUnchecked`(`eventId`: kotlin.String) { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_mark_as_fully_read_unchecked( + thisPtr, + FfiConverterString.lower(`eventId`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + // lift function + { Unit }, + + // Error FFI converter + ClientException.ErrorHandler, + ) + } + + /** * Mark a room as read, by attaching a read receipt on the latest event. * @@ -17133,6 +19406,26 @@ open class Room: Disposable, AutoCloseable, RoomInterface } + /** + * Subscribes to call decline for a currently ringing call, using a + * `listener` to be notified when someone declines. + * + * Will error if `rtc_notification_event_id` is not a valid event id. + * Use the [`TaskHandle`] to cancel the subscription. + */ + @Throws(ClientException::class)override fun `subscribeToCallDeclineEvents`(`rtcNotificationEventId`: kotlin.String, `listener`: CallDeclineListener): TaskHandle { + return FfiConverterTypeTaskHandle.lift( + callWithPointer { + uniffiRustCallWithError(ClientException) { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_subscribe_to_call_decline_events( + it, FfiConverterString.lower(`rtcNotificationEventId`),FfiConverterTypeCallDeclineListener.lower(`listener`),_status) +} + } + ) + } + + + @Throws(ClientException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") override suspend fun `subscribeToIdentityStatusChanges`(`listener`: IdentityStatusChangeListener) : TaskHandle { @@ -17213,6 +19506,34 @@ open class Room: Disposable, AutoCloseable, RoomInterface } + + /** + * Subscribe to all send queue updates in this room. + * + * The given listener will be immediately called with + * `RoomSendQueueUpdate::NewLocalEvent` for each local echo existing in + * the queue. + */ + @Throws(ClientException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `subscribeToSendQueueUpdates`(`listener`: SendQueueListener) : TaskHandle { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_room_subscribe_to_send_queue_updates( + thisPtr, + FfiConverterTypeSendQueueListener.lower(`listener`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, + // lift function + { FfiConverterTypeTaskHandle.lift(it) }, + // Error FFI converter + ClientException.ErrorHandler, + ) + } + override fun `subscribeToTypingNotifications`(`listener`: TypingNotificationsListener): TaskHandle { return FfiConverterTypeTaskHandle.lift( callWithPointer { @@ -18110,6 +20431,8 @@ public interface RoomListInterface { fun `entriesWithDynamicAdapters`(`pageSize`: kotlin.UInt, `listener`: RoomListEntriesListener): RoomListEntriesWithDynamicAdaptersResult + fun `entriesWithDynamicAdaptersWith`(`pageSize`: kotlin.UInt, `enableLatestEventSorter`: kotlin.Boolean, `listener`: RoomListEntriesListener): RoomListEntriesWithDynamicAdaptersResult + fun `loadingState`(`listener`: RoomListLoadingStateListener): RoomListLoadingStateResult fun `room`(`roomId`: kotlin.String): Room @@ -18211,6 +20534,18 @@ open class RoomList: Disposable, AutoCloseable, RoomListInterface } + override fun `entriesWithDynamicAdaptersWith`(`pageSize`: kotlin.UInt, `enableLatestEventSorter`: kotlin.Boolean, `listener`: RoomListEntriesListener): RoomListEntriesWithDynamicAdaptersResult { + return FfiConverterTypeRoomListEntriesWithDynamicAdaptersResult.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_roomlist_entries_with_dynamic_adapters_with( + it, FfiConverterUInt.lower(`pageSize`),FfiConverterBoolean.lower(`enableLatestEventSorter`),FfiConverterTypeRoomListEntriesListener.lower(`listener`),_status) +} + } + ) + } + + @Throws(RoomListException::class)override fun `loadingState`(`listener`: RoomListLoadingStateListener): RoomListLoadingStateResult { return FfiConverterTypeRoomListLoadingStateResult.lift( @@ -22396,6 +24731,11 @@ public interface SpaceRoomListInterface { */ fun `rooms`(): List + /** + * Returns the space of the room list if known. + */ + fun `space`(): SpaceRoom? + /** * Subscribe to pagination updates. */ @@ -22406,6 +24746,11 @@ public interface SpaceRoomListInterface { */ fun `subscribeToRoomUpdate`(`listener`: SpaceRoomListEntriesListener): TaskHandle + /** + * Subscribe to space updates. + */ + fun `subscribeToSpaceUpdates`(`listener`: SpaceRoomListSpaceListener): TaskHandle + companion object } @@ -22559,6 +24904,21 @@ open class SpaceRoomList: Disposable, AutoCloseable, SpaceRoomListInterface + /** + * Returns the space of the room list if known. + */override fun `space`(): SpaceRoom? { + return FfiConverterOptionalTypeSpaceRoom.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_spaceroomlist_space( + it, _status) +} + } + ) + } + + + /** * Subscribe to pagination updates. */override fun `subscribeToPaginationStateUpdates`(`listener`: SpaceRoomListPaginationStateListener): TaskHandle { @@ -22589,6 +24949,21 @@ open class SpaceRoomList: Disposable, AutoCloseable, SpaceRoomListInterface + /** + * Subscribe to space updates. + */override fun `subscribeToSpaceUpdates`(`listener`: SpaceRoomListSpaceListener): TaskHandle { + return FfiConverterTypeTaskHandle.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_spaceroomlist_subscribe_to_space_updates( + it, FfiConverterTypeSpaceRoomListSpaceListener.lower(`listener`),_status) +} + } + ) + } + + + @@ -22732,6 +25107,22 @@ public object FfiConverterTypeSpaceRoomList: FfiConverter + + /** + * Returns all known direct-parents of a given space room ID. + */ + suspend fun `joinedParentsOfChild`(`childId`: kotlin.String): List + /** * Returns a list of all the top-level joined spaces. It will eagerly * compute the latest version and also notify subscribers if there were @@ -22739,6 +25130,19 @@ public interface SpaceServiceInterface { */ suspend fun `joinedSpaces`(): List + /** + * Start a space leave process returning a [`LeaveSpaceHandle`] from which + * rooms can be retrieved in reversed BFS order starting from the requested + * `space_id` graph node. If the room is unknown then an error will be + * returned. + * + * Once the rooms to be left are chosen the handle can be used to leave + * them. + */ + suspend fun `leaveSpace`(`spaceId`: kotlin.String): LeaveSpaceHandle + + suspend fun `removeChildFromSpace`(`childId`: kotlin.String, `spaceId`: kotlin.String) + /** * Returns a `SpaceRoomList` for the given space ID. */ @@ -22830,7 +25234,466 @@ open class SpaceService: Disposable, AutoCloseable, SpaceServiceInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_spaceservice(ptr, status) + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_spaceservice(ptr, status) + } + } + } + } + + fun uniffiClonePointer(): Pointer { + return uniffiRustCall() { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_spaceservice(pointer!!, status) + } + } + + + @Throws(ClientException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `addChildToSpace`(`childId`: kotlin.String, `spaceId`: kotlin.String) { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_spaceservice_add_child_to_space( + thisPtr, + FfiConverterString.lower(`childId`),FfiConverterString.lower(`spaceId`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + // lift function + { Unit }, + + // Error FFI converter + ClientException.ErrorHandler, + ) + } + + + /** + * Returns a flattened list containing all the spaces where the user has + * permission to send `m.space.child` state events. + * + * Note: Unlike [`Self::joined_spaces()`], this method does not recompute + * the space graph, nor does it notify subscribers about changes. + */ + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `editableSpaces`() : List { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_spaceservice_editable_spaces( + thisPtr, + + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterSequenceTypeSpaceRoom.lift(it) }, + // Error FFI converter + UniffiNullRustCallStatusErrorHandler, + ) + } + + + /** + * Returns all known direct-parents of a given space room ID. + */ + @Throws(ClientException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `joinedParentsOfChild`(`childId`: kotlin.String) : List { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_spaceservice_joined_parents_of_child( + thisPtr, + FfiConverterString.lower(`childId`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterSequenceTypeSpaceRoom.lift(it) }, + // Error FFI converter + ClientException.ErrorHandler, + ) + } + + + /** + * Returns a list of all the top-level joined spaces. It will eagerly + * compute the latest version and also notify subscribers if there were + * any changes. + */ + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `joinedSpaces`() : List { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_spaceservice_joined_spaces( + thisPtr, + + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterSequenceTypeSpaceRoom.lift(it) }, + // Error FFI converter + UniffiNullRustCallStatusErrorHandler, + ) + } + + + /** + * Start a space leave process returning a [`LeaveSpaceHandle`] from which + * rooms can be retrieved in reversed BFS order starting from the requested + * `space_id` graph node. If the room is unknown then an error will be + * returned. + * + * Once the rooms to be left are chosen the handle can be used to leave + * them. + */ + @Throws(ClientException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `leaveSpace`(`spaceId`: kotlin.String) : LeaveSpaceHandle { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_spaceservice_leave_space( + thisPtr, + FfiConverterString.lower(`spaceId`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, + // lift function + { FfiConverterTypeLeaveSpaceHandle.lift(it) }, + // Error FFI converter + ClientException.ErrorHandler, + ) + } + + + @Throws(ClientException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `removeChildFromSpace`(`childId`: kotlin.String, `spaceId`: kotlin.String) { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_spaceservice_remove_child_from_space( + thisPtr, + FfiConverterString.lower(`childId`),FfiConverterString.lower(`spaceId`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + // lift function + { Unit }, + + // Error FFI converter + ClientException.ErrorHandler, + ) + } + + + /** + * Returns a `SpaceRoomList` for the given space ID. + */ + @Throws(ClientException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `spaceRoomList`(`spaceId`: kotlin.String) : SpaceRoomList { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_spaceservice_space_room_list( + thisPtr, + FfiConverterString.lower(`spaceId`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, + // lift function + { FfiConverterTypeSpaceRoomList.lift(it) }, + // Error FFI converter + ClientException.ErrorHandler, + ) + } + + + /** + * Subscribes to updates on the joined spaces list. If space rooms are + * joined or left, the stream will yield diffs that reflect the changes. + */ + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `subscribeToJoinedSpaces`(`listener`: SpaceServiceJoinedSpacesListener) : TaskHandle { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_spaceservice_subscribe_to_joined_spaces( + thisPtr, + FfiConverterTypeSpaceServiceJoinedSpacesListener.lower(`listener`), + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, + // lift function + { FfiConverterTypeTaskHandle.lift(it) }, + // Error FFI converter + UniffiNullRustCallStatusErrorHandler, + ) + } + + + + + + companion object + +} + +/** + * @suppress + */ +public object FfiConverterTypeSpaceService: FfiConverter { + + override fun lower(value: SpaceService): Pointer { + return value.uniffiClonePointer() + } + + override fun lift(value: Pointer): SpaceService { + return SpaceService(value) + } + + override fun read(buf: ByteBuffer): SpaceService { + // The Rust code always writes pointers as 8 bytes, and will + // fail to compile if they don't fit. + return lift(Pointer(buf.getLong())) + } + + override fun allocationSize(value: SpaceService) = 8UL + + override fun write(value: SpaceService, buf: ByteBuffer) { + // The Rust code always expects pointers written as 8 bytes, + // and will fail to compile if they don't fit. + buf.putLong(Pointer.nativeValue(lower(value))) + } +} + + +// This template implements a class for working with a Rust struct via a Pointer/Arc +// to the live Rust struct on the other side of the FFI. +// +// Each instance implements core operations for working with the Rust `Arc` and the +// Kotlin Pointer to work with the live Rust struct on the other side of the FFI. +// +// There's some subtlety here, because we have to be careful not to operate on a Rust +// struct after it has been dropped, and because we must expose a public API for freeing +// theq Kotlin wrapper object in lieu of reliable finalizers. The core requirements are: +// +// * Each instance holds an opaque pointer to the underlying Rust struct. +// Method calls need to read this pointer from the object's state and pass it in to +// the Rust FFI. +// +// * When an instance is no longer needed, its pointer should be passed to a +// special destructor function provided by the Rust FFI, which will drop the +// underlying Rust struct. +// +// * Given an instance, calling code is expected to call the special +// `destroy` method in order to free it after use, either by calling it explicitly +// or by using a higher-level helper like the `use` method. Failing to do so risks +// leaking the underlying Rust struct. +// +// * We can't assume that calling code will do the right thing, and must be prepared +// to handle Kotlin method calls executing concurrently with or even after a call to +// `destroy`, and to handle multiple (possibly concurrent!) calls to `destroy`. +// +// * We must never allow Rust code to operate on the underlying Rust struct after +// the destructor has been called, and must never call the destructor more than once. +// Doing so may trigger memory unsafety. +// +// * To mitigate many of the risks of leaking memory and use-after-free unsafety, a `Cleaner` +// is implemented to call the destructor when the Kotlin object becomes unreachable. +// This is done in a background thread. This is not a panacea, and client code should be aware that +// 1. the thread may starve if some there are objects that have poorly performing +// `drop` methods or do significant work in their `drop` methods. +// 2. the thread is shared across the whole library. This can be tuned by using `android_cleaner = true`, +// or `android = true` in the [`kotlin` section of the `uniffi.toml` file](https://mozilla.github.io/uniffi-rs/kotlin/configuration.html). +// +// If we try to implement this with mutual exclusion on access to the pointer, there is the +// possibility of a race between a method call and a concurrent call to `destroy`: +// +// * Thread A starts a method call, reads the value of the pointer, but is interrupted +// before it can pass the pointer over the FFI to Rust. +// * Thread B calls `destroy` and frees the underlying Rust struct. +// * Thread A resumes, passing the already-read pointer value to Rust and triggering +// a use-after-free. +// +// One possible solution would be to use a `ReadWriteLock`, with each method call taking +// a read lock (and thus allowed to run concurrently) and the special `destroy` method +// taking a write lock (and thus blocking on live method calls). However, we aim not to +// generate methods with any hidden blocking semantics, and a `destroy` method that might +// block if called incorrectly seems to meet that bar. +// +// So, we achieve our goals by giving each instance an associated `AtomicLong` counter to track +// the number of in-flight method calls, and an `AtomicBoolean` flag to indicate whether `destroy` +// has been called. These are updated according to the following rules: +// +// * The initial value of the counter is 1, indicating a live object with no in-flight calls. +// The initial value for the flag is false. +// +// * At the start of each method call, we atomically check the counter. +// If it is 0 then the underlying Rust struct has already been destroyed and the call is aborted. +// If it is nonzero them we atomically increment it by 1 and proceed with the method call. +// +// * At the end of each method call, we atomically decrement and check the counter. +// If it has reached zero then we destroy the underlying Rust struct. +// +// * When `destroy` is called, we atomically flip the flag from false to true. +// If the flag was already true we silently fail. +// Otherwise we atomically decrement and check the counter. +// If it has reached zero then we destroy the underlying Rust struct. +// +// Astute readers may observe that this all sounds very similar to the way that Rust's `Arc` works, +// and indeed it is, with the addition of a flag to guard against multiple calls to `destroy`. +// +// The overall effect is that the underlying Rust struct is destroyed only when `destroy` has been +// called *and* all in-flight method calls have completed, avoiding violating any of the expectations +// of the underlying Rust code. +// +// This makes a cleaner a better alternative to _not_ calling `destroy()` as +// and when the object is finished with, but the abstraction is not perfect: if the Rust object's `drop` +// method is slow, and/or there are many objects to cleanup, and it's on a low end Android device, then the cleaner +// thread may be starved, and the app will leak memory. +// +// In this case, `destroy`ing manually may be a better solution. +// +// The cleaner can live side by side with the manual calling of `destroy`. In the order of responsiveness, uniffi objects +// with Rust peers are reclaimed: +// +// 1. By calling the `destroy` method of the object, which calls `rustObject.free()`. If that doesn't happen: +// 2. When the object becomes unreachable, AND the Cleaner thread gets to call `rustObject.free()`. If the thread is starved then: +// 3. The memory is reclaimed when the process terminates. +// +// [1] https://stackoverflow.com/questions/24376768/can-java-finalize-an-object-when-it-is-still-in-scope/24380219 +// + + +public interface SpanInterface { + + fun `enter`() + + fun `exit`() + + fun `isNone`(): kotlin.Boolean + + companion object +} + +open class Span: Disposable, AutoCloseable, SpanInterface +{ + + constructor(pointer: Pointer) { + this.pointer = pointer + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + + /** + * This constructor can be used to instantiate a fake object. Only used for tests. Any + * attempt to actually use an object constructed this way will fail as there is no + * connected Rust object. + */ + @Suppress("UNUSED_PARAMETER") + constructor(noPointer: NoPointer) { + this.pointer = null + this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) + } + /** + * Create a span originating at the given callsite (file, line and column). + * + * The target should be something like a module path, and can be referenced + * in the filter string given to `setup_tracing`. `level` and `target` + * for a callsite are fixed at the first creation of a span for that + * callsite and can not be changed afterwards, i.e. the level and + * target passed for second and following creation of a span with the same + * callsite will be ignored. + * + * This function leaks a little bit of memory for each unique (file + + * line + level + target + name) it is called with. Please make sure that + * the number of different combinations of those parameters this can be + * called with is constant in the final executable. + * + * For a span to have an effect, you must `.enter()` it at the start of a + * logical unit of work and `.exit()` it at the end of the same (including + * on failure). Entering registers the span in thread-local storage, so + * future calls to `log_event` on the same thread are able to attach the + * events they create to the span, exiting unregisters it. For this to + * work, exiting a span must be done on the same thread where it was + * entered. It is possible to enter a span on multiple threads, in which + * case it should also be exited on all of them individually; that is, + * unless you *want* the span to be attached to all further events created + * on that thread. + */ + constructor(`file`: kotlin.String, `line`: kotlin.UInt?, `level`: LogLevel, `target`: kotlin.String, `name`: kotlin.String, `bridgeTraceId`: kotlin.String?) : + this( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_constructor_span_new( + FfiConverterString.lower(`file`),FfiConverterOptionalUInt.lower(`line`),FfiConverterTypeLogLevel.lower(`level`),FfiConverterString.lower(`target`),FfiConverterString.lower(`name`),FfiConverterOptionalString.lower(`bridgeTraceId`),_status) +} + ) + + protected val pointer: Pointer? + protected val cleanable: UniffiCleaner.Cleanable + + private val wasDestroyed = AtomicBoolean(false) + private val callCounter = AtomicLong(1) + + override fun destroy() { + // Only allow a single call to this method. + // TODO: maybe we should log a warning if called more than once? + if (this.wasDestroyed.compareAndSet(false, true)) { + // This decrement always matches the initial count of 1 given at creation time. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + @Synchronized + override fun close() { + this.destroy() + } + + internal inline fun callWithPointer(block: (ptr: Pointer) -> R): R { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + do { + val c = this.callCounter.get() + if (c == 0L) { + throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed") + } + if (c == Long.MAX_VALUE) { + throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow") + } + } while (! this.callCounter.compareAndSet(c, c + 1L)) + // Now we can safely do the method call without the pointer being freed concurrently. + try { + return block(this.uniffiClonePointer()) + } finally { + // This decrement always matches the increment we performed above. + if (this.callCounter.decrementAndGet() == 0L) { + cleanable.clean() + } + } + } + + // Use a static inner class instead of a closure so as not to accidentally + // capture `this` as part of the cleanable's action. + private class UniffiCleanAction(private val pointer: Pointer?) : Runnable { + override fun run() { + pointer?.let { ptr -> + uniffiRustCall { status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_span(ptr, status) } } } @@ -22838,113 +25701,101 @@ open class SpaceService: Disposable, AutoCloseable, SpaceServiceInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_spaceservice(pointer!!, status) + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_span(pointer!!, status) } } + override fun `enter`() + = + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_span_enter( + it, _status) +} + } - /** - * Returns a list of all the top-level joined spaces. It will eagerly - * compute the latest version and also notify subscribers if there were - * any changes. - */ - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `joinedSpaces`() : List { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_spaceservice_joined_spaces( - thisPtr, - - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, - // lift function - { FfiConverterSequenceTypeSpaceRoom.lift(it) }, - // Error FFI converter - UniffiNullRustCallStatusErrorHandler, + + + override fun `exit`() + = + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_span_exit( + it, _status) +} + } + + + + override fun `isNone`(): kotlin.Boolean { + return FfiConverterBoolean.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_span_is_none( + it, _status) +} + } ) } + - /** - * Returns a `SpaceRoomList` for the given space ID. - */ - @Throws(ClientException::class) - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `spaceRoomList`(`spaceId`: kotlin.String) : SpaceRoomList { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_spaceservice_space_room_list( - thisPtr, - FfiConverterString.lower(`spaceId`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, - // lift function - { FfiConverterTypeSpaceRoomList.lift(it) }, - // Error FFI converter - ClientException.ErrorHandler, + + + companion object { + fun `current`(): Span { + return FfiConverterTypeSpan.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_constructor_span_current( + _status) +} ) } - + + /** - * Subscribes to updates on the joined spaces list. If space rooms are - * joined or left, the stream will yield diffs that reflect the changes. - */ - @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `subscribeToJoinedSpaces`(`listener`: SpaceServiceJoinedSpacesListener) : TaskHandle { - return uniffiRustCallAsync( - callWithPointer { thisPtr -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_spaceservice_subscribe_to_joined_spaces( - thisPtr, - FfiConverterTypeSpaceServiceJoinedSpacesListener.lower(`listener`), - ) - }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_pointer(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_pointer(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_pointer(future) }, - // lift function - { FfiConverterTypeTaskHandle.lift(it) }, - // Error FFI converter - UniffiNullRustCallStatusErrorHandler, + * Creates a [`Span`] that acts as a bridge between the client spans and + * the SDK ones, allowing them to be joined in Sentry. This function + * will only return a valid span if the `sentry` feature is enabled, + * otherwise it will return a noop span. + */ fun `newBridgeSpan`(`target`: kotlin.String, `parentTraceId`: kotlin.String?): Span { + return FfiConverterTypeSpan.lift( + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_constructor_span_new_bridge_span( + FfiConverterString.lower(`target`),FfiConverterOptionalString.lower(`parentTraceId`),_status) +} ) } - - - - companion object + + } } /** * @suppress */ -public object FfiConverterTypeSpaceService: FfiConverter { +public object FfiConverterTypeSpan: FfiConverter { - override fun lower(value: SpaceService): Pointer { + override fun lower(value: Span): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): SpaceService { - return SpaceService(value) + override fun lift(value: Pointer): Span { + return Span(value) } - override fun read(buf: ByteBuffer): SpaceService { + override fun read(buf: ByteBuffer): Span { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: SpaceService) = 8UL + override fun allocationSize(value: Span) = 8UL - override fun write(value: SpaceService, buf: ByteBuffer) { + override fun write(value: Span, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -23050,18 +25901,70 @@ public object FfiConverterTypeSpaceService: FfiConverter // -public interface SpanInterface { +/** + * A builder for configuring a Sqlite session store. + */ +public interface SqliteStoreBuilderInterface { - fun `enter`() + /** + * Set the cache size for the stores. + * + * Each store exposes a SQLite connection. This method controls the + * cache size, in **bytes (!)**. + * + * The cache represents data SQLite holds in memory at once per open + * database file. The default cache implementation does not allocate + * the full amount of cache memory all at once. Cache memory is + * allocated in smaller chunks on an as-needed basis. + * + * See [`SqliteStoreConfig::cache_size`] to learn more. + */ + fun `cacheSize`(`cacheSize`: kotlin.UInt?): SqliteStoreBuilder - fun `exit`() + /** + * Set the size limit for the SQLite WAL files of stores. + * + * Each store uses the WAL journal mode. This method controls the size + * limit of the WAL files, in **bytes (!)**. + * + * See [`SqliteStoreConfig::journal_size_limit`] to learn more. + */ + fun `journalSizeLimit`(`limit`: kotlin.UInt?): SqliteStoreBuilder - fun `isNone`(): kotlin.Boolean + /** + * Set the passphrase for the stores. + */ + fun `passphrase`(`passphrase`: kotlin.String?): SqliteStoreBuilder + + /** + * Set the pool max size for the stores. + * + * Each store exposes an async pool of connections. This method + * controls the size of the pool. The larger the pool is, the more + * memory is consumed, but also the more the app is reactive because it + * doesn't need to wait on a pool to be available to run queries. + * + * See [`SqliteStoreConfig::pool_max_size`] to learn more. + */ + fun `poolMaxSize`(`poolMaxSize`: kotlin.UInt?): SqliteStoreBuilder + + /** + * Tell the client that the system is memory constrained, like in a + * push notification process for example. + * + * So far, at the time of writing (2025-04-07), it changes + * the defaults of [`SqliteStoreConfig`]. Please check + * [`SqliteStoreConfig::with_low_memory_config`]. + */ + fun `systemIsMemoryConstrained`(): SqliteStoreBuilder companion object } -open class Span: Disposable, AutoCloseable, SpanInterface +/** + * A builder for configuring a Sqlite session store. + */ +open class SqliteStoreBuilder: Disposable, AutoCloseable, SqliteStoreBuilderInterface { constructor(pointer: Pointer) { @@ -23080,36 +25983,18 @@ open class Span: Disposable, AutoCloseable, SpanInterface this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(pointer)) } /** - * Create a span originating at the given callsite (file, line and column). - * - * The target should be something like a module path, and can be referenced - * in the filter string given to `setup_tracing`. `level` and `target` - * for a callsite are fixed at the first creation of a span for that - * callsite and can not be changed afterwards, i.e. the level and - * target passed for second and following creation of a span with the same - * callsite will be ignored. - * - * This function leaks a little bit of memory for each unique (file + - * line + level + target + name) it is called with. Please make sure that - * the number of different combinations of those parameters this can be - * called with is constant in the final executable. + * Construct a [`SqliteStoreBuilder`] and set the paths that the client + * will use to store its data and caches. * - * For a span to have an effect, you must `.enter()` it at the start of a - * logical unit of work and `.exit()` it at the end of the same (including - * on failure). Entering registers the span in thread-local storage, so - * future calls to `log_event` on the same thread are able to attach the - * events they create to the span, exiting unregisters it. For this to - * work, exiting a span must be done on the same thread where it was - * entered. It is possible to enter a span on multiple threads, in which - * case it should also be exited on all of them individually; that is, - * unless you *want* the span to be attached to all further events created - * on that thread. + * Both paths **must** be unique per session as the SDK stores aren't + * capable of handling multiple users, however it is valid to use the + * same path for both stores on a single session. */ - constructor(`file`: kotlin.String, `line`: kotlin.UInt?, `level`: LogLevel, `target`: kotlin.String, `name`: kotlin.String) : + constructor(`dataPath`: kotlin.String, `cachePath`: kotlin.String) : this( uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_constructor_span_new( - FfiConverterString.lower(`file`),FfiConverterOptionalUInt.lower(`line`),FfiConverterTypeLogLevel.lower(`level`),FfiConverterString.lower(`target`),FfiConverterString.lower(`name`),_status) + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_constructor_sqlitestorebuilder_new( + FfiConverterString.lower(`dataPath`),FfiConverterString.lower(`cachePath`),_status) } ) @@ -23164,7 +26049,7 @@ open class Span: Disposable, AutoCloseable, SpanInterface override fun run() { pointer?.let { ptr -> uniffiRustCall { status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_span(ptr, status) + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_free_sqlitestorebuilder(ptr, status) } } } @@ -23172,38 +26057,64 @@ open class Span: Disposable, AutoCloseable, SpanInterface fun uniffiClonePointer(): Pointer { return uniffiRustCall() { status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_span(pointer!!, status) + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_clone_sqlitestorebuilder(pointer!!, status) } } - override fun `enter`() - = + + /** + * Set the cache size for the stores. + * + * Each store exposes a SQLite connection. This method controls the + * cache size, in **bytes (!)**. + * + * The cache represents data SQLite holds in memory at once per open + * database file. The default cache implementation does not allocate + * the full amount of cache memory all at once. Cache memory is + * allocated in smaller chunks on an as-needed basis. + * + * See [`SqliteStoreConfig::cache_size`] to learn more. + */override fun `cacheSize`(`cacheSize`: kotlin.UInt?): SqliteStoreBuilder { + return FfiConverterTypeSqliteStoreBuilder.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_span_enter( - it, _status) + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sqlitestorebuilder_cache_size( + it, FfiConverterOptionalUInt.lower(`cacheSize`),_status) } } - + ) + } - override fun `exit`() - = + + /** + * Set the size limit for the SQLite WAL files of stores. + * + * Each store uses the WAL journal mode. This method controls the size + * limit of the WAL files, in **bytes (!)**. + * + * See [`SqliteStoreConfig::journal_size_limit`] to learn more. + */override fun `journalSizeLimit`(`limit`: kotlin.UInt?): SqliteStoreBuilder { + return FfiConverterTypeSqliteStoreBuilder.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_span_exit( - it, _status) + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sqlitestorebuilder_journal_size_limit( + it, FfiConverterOptionalUInt.lower(`limit`),_status) } } - + ) + } - override fun `isNone`(): kotlin.Boolean { - return FfiConverterBoolean.lift( + + /** + * Set the passphrase for the stores. + */override fun `passphrase`(`passphrase`: kotlin.String?): SqliteStoreBuilder { + return FfiConverterTypeSqliteStoreBuilder.lift( callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_span_is_none( - it, _status) + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sqlitestorebuilder_passphrase( + it, FfiConverterOptionalString.lower(`passphrase`),_status) } } ) @@ -23211,46 +26122,77 @@ open class Span: Disposable, AutoCloseable, SpanInterface + /** + * Set the pool max size for the stores. + * + * Each store exposes an async pool of connections. This method + * controls the size of the pool. The larger the pool is, the more + * memory is consumed, but also the more the app is reactive because it + * doesn't need to wait on a pool to be available to run queries. + * + * See [`SqliteStoreConfig::pool_max_size`] to learn more. + */override fun `poolMaxSize`(`poolMaxSize`: kotlin.UInt?): SqliteStoreBuilder { + return FfiConverterTypeSqliteStoreBuilder.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sqlitestorebuilder_pool_max_size( + it, FfiConverterOptionalUInt.lower(`poolMaxSize`),_status) +} + } + ) + } + - companion object { - fun `current`(): Span { - return FfiConverterTypeSpan.lift( + /** + * Tell the client that the system is memory constrained, like in a + * push notification process for example. + * + * So far, at the time of writing (2025-04-07), it changes + * the defaults of [`SqliteStoreConfig`]. Please check + * [`SqliteStoreConfig::with_low_memory_config`]. + */override fun `systemIsMemoryConstrained`(): SqliteStoreBuilder { + return FfiConverterTypeSqliteStoreBuilder.lift( + callWithPointer { uniffiRustCall() { _status -> - UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_constructor_span_current( - _status) + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_sqlitestorebuilder_system_is_memory_constrained( + it, _status) } + } ) } - - } + + + + + companion object } /** * @suppress */ -public object FfiConverterTypeSpan: FfiConverter { +public object FfiConverterTypeSqliteStoreBuilder: FfiConverter { - override fun lower(value: Span): Pointer { + override fun lower(value: SqliteStoreBuilder): Pointer { return value.uniffiClonePointer() } - override fun lift(value: Pointer): Span { - return Span(value) + override fun lift(value: Pointer): SqliteStoreBuilder { + return SqliteStoreBuilder(value) } - override fun read(buf: ByteBuffer): Span { + override fun read(buf: ByteBuffer): SqliteStoreBuilder { // The Rust code always writes pointers as 8 bytes, and will // fail to compile if they don't fit. return lift(Pointer(buf.getLong())) } - override fun allocationSize(value: Span) = 8UL + override fun allocationSize(value: SqliteStoreBuilder) = 8UL - override fun write(value: Span, buf: ByteBuffer) { + override fun write(value: SqliteStoreBuilder, buf: ByteBuffer) { // The Rust code always expects pointers written as 8 bytes, // and will fail to compile if they don't fit. buf.putLong(Pointer.nativeValue(lower(value))) @@ -24819,6 +27761,11 @@ public interface TimelineInterface { */ suspend fun `getEventTimelineItemByEventId`(`eventId`: kotlin.String): EventTimelineItem + /** + * Returns the latest [`EventId`] in the timeline. + */ + suspend fun `latestEventId`(): kotlin.String? + /** * Load the reply details for the given event id. * @@ -24828,12 +27775,21 @@ public interface TimelineInterface { suspend fun `loadReplyDetails`(`eventIdStr`: kotlin.String): InReplyToDetails /** - * Mark the room as read by trying to attach an *unthreaded* read receipt - * to the latest room event. + * Mark the timeline as read by attempting to send a read receipt on the + * latest visible event. + * + * The latest visible event is determined from the timeline's focus kind + * and whether or not it hides threaded events. If no latest event can + * be determined and the timeline is live, the room's unread marker is + * unset instead. * - * This works even if the latest event belongs to a thread, as a threaded - * reply also belongs to the unthreaded timeline. No threaded receipt - * will be sent here (see also #3123). + * # Arguments + * + * * `receipt_type` - The type of receipt to send. When using + * [`ReceiptType::FullyRead`], an unthreaded receipt will be sent. This + * works even if the latest event belongs to a thread, as a threaded + * reply also belongs to the unthreaded timeline. Otherwise the receipt + * thread will be determined based on the timeline's focus kind. */ suspend fun `markAsRead`(`receiptType`: ReceiptType) @@ -24909,7 +27865,7 @@ public interface TimelineInterface { fun `sendVideo`(`params`: UploadParameters, `thumbnailSource`: UploadSource?, `videoInfo`: VideoInfo): SendAttachmentJoinHandle - fun `sendVoiceMessage`(`params`: UploadParameters, `audioInfo`: AudioInfo, `waveform`: List): SendAttachmentJoinHandle + fun `sendVoiceMessage`(`params`: UploadParameters, `audioInfo`: AudioInfo, `waveform`: List): SendAttachmentJoinHandle suspend fun `subscribeToBackPaginationStatus`(`listener`: PaginationStatusListener): TaskHandle @@ -24925,8 +27881,10 @@ public interface TimelineInterface { * * Ensures that only one reaction is sent at a time to avoid race * conditions and spamming the homeserver with requests. + * + * Returns `true` if the reaction was added, `false` if it was removed. */ - suspend fun `toggleReaction`(`itemId`: EventOrTransactionId, `key`: kotlin.String) + suspend fun `toggleReaction`(`itemId`: EventOrTransactionId, `key`: kotlin.String): kotlin.Boolean /** * Adds a new pinned event by sending an updated `m.room.pinned_events` @@ -25205,6 +28163,29 @@ open class Timeline: Disposable, AutoCloseable, TimelineInterface } + /** + * Returns the latest [`EventId`] in the timeline. + */ + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `latestEventId`() : kotlin.String? { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_latest_event_id( + thisPtr, + + ) + }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterOptionalString.lift(it) }, + // Error FFI converter + UniffiNullRustCallStatusErrorHandler, + ) + } + + /** * Load the reply details for the given event id. * @@ -25233,12 +28214,21 @@ open class Timeline: Disposable, AutoCloseable, TimelineInterface /** - * Mark the room as read by trying to attach an *unthreaded* read receipt - * to the latest room event. + * Mark the timeline as read by attempting to send a read receipt on the + * latest visible event. + * + * The latest visible event is determined from the timeline's focus kind + * and whether or not it hides threaded events. If no latest event can + * be determined and the timeline is live, the room's unread marker is + * unset instead. * - * This works even if the latest event belongs to a thread, as a threaded - * reply also belongs to the unthreaded timeline. No threaded receipt - * will be sent here (see also #3123). + * # Arguments + * + * * `receipt_type` - The type of receipt to send. When using + * [`ReceiptType::FullyRead`], an unthreaded receipt will be sent. This + * works even if the latest event belongs to a thread, as a threaded + * reply also belongs to the unthreaded timeline. Otherwise the receipt + * thread will be determined based on the timeline's focus kind. */ @Throws(ClientException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") @@ -25574,12 +28564,12 @@ open class Timeline: Disposable, AutoCloseable, TimelineInterface - @Throws(RoomException::class)override fun `sendVoiceMessage`(`params`: UploadParameters, `audioInfo`: AudioInfo, `waveform`: List): SendAttachmentJoinHandle { + @Throws(RoomException::class)override fun `sendVoiceMessage`(`params`: UploadParameters, `audioInfo`: AudioInfo, `waveform`: List): SendAttachmentJoinHandle { return FfiConverterTypeSendAttachmentJoinHandle.lift( callWithPointer { uniffiRustCallWithError(RoomException) { _status -> UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_send_voice_message( - it, FfiConverterTypeUploadParameters.lower(`params`),FfiConverterTypeAudioInfo.lower(`audioInfo`),FfiConverterSequenceUShort.lower(`waveform`),_status) + it, FfiConverterTypeUploadParameters.lower(`params`),FfiConverterTypeAudioInfo.lower(`audioInfo`),FfiConverterSequenceFloat.lower(`waveform`),_status) } } ) @@ -25620,10 +28610,12 @@ open class Timeline: Disposable, AutoCloseable, TimelineInterface * * Ensures that only one reaction is sent at a time to avoid race * conditions and spamming the homeserver with requests. + * + * Returns `true` if the reaction was added, `false` if it was removed. */ @Throws(ClientException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") - override suspend fun `toggleReaction`(`itemId`: EventOrTransactionId, `key`: kotlin.String) { + override suspend fun `toggleReaction`(`itemId`: EventOrTransactionId, `key`: kotlin.String) : kotlin.Boolean { return uniffiRustCallAsync( callWithPointer { thisPtr -> UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timeline_toggle_reaction( @@ -25631,12 +28623,11 @@ open class Timeline: Disposable, AutoCloseable, TimelineInterface FfiConverterTypeEventOrTransactionId.lower(`itemId`),FfiConverterString.lower(`key`), ) }, - { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_void(future, callback, continuation) }, - { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_void(future, continuation) }, - { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_void(future) }, + { future, callback, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_poll_i8(future, callback, continuation) }, + { future, continuation -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_complete_i8(future, continuation) }, + { future -> UniffiLib.INSTANCE.ffi_matrix_sdk_ffi_rust_future_free_i8(future) }, // lift function - { Unit }, - + { FfiConverterBoolean.lift(it) }, // Error FFI converter ClientException.ErrorHandler, ) @@ -25813,6 +28804,12 @@ public interface TimelineEventInterface { fun `senderId`(): kotlin.String + /** + * Returns the thread root event id for the event, if it's part of a + * thread. + */ + fun `threadRootEventId`(): kotlin.String? + fun `timestamp`(): Timestamp companion object @@ -25937,6 +28934,22 @@ open class TimelineEvent: Disposable, AutoCloseable, TimelineEventInterface } + + /** + * Returns the thread root event id for the event, if it's part of a + * thread. + */override fun `threadRootEventId`(): kotlin.String? { + return FfiConverterOptionalString.lift( + callWithPointer { + uniffiRustCall() { _status -> + UniffiLib.INSTANCE.uniffi_matrix_sdk_ffi_fn_method_timelineevent_thread_root_event_id( + it, _status) +} + } + ) + } + + override fun `timestamp`(): Timestamp { return FfiConverterTypeTimestamp.lift( callWithPointer { @@ -28005,8 +31018,23 @@ data class ComposerDraft ( /** * The type of draft. */ - var `draftType`: ComposerDraftType -) { + var `draftType`: ComposerDraftType, + /** + * Attachments associated with this draft. + */ + var `attachments`: List +) : Disposable { + + @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here + override fun destroy() { + + Disposable.destroy( + this.`plainText`, + this.`htmlText`, + this.`draftType`, + this.`attachments` + ) + } companion object } @@ -28020,19 +31048,22 @@ public object FfiConverterTypeComposerDraft: FfiConverterRustBuffer +/** + * Space leaving specific room that groups normal [`SpaceRoom`] details with + * information about the leaving user's role. + */ +data class LeaveSpaceRoom ( + /** + * The underlying [`SpaceRoom`] + */ + var `spaceRoom`: SpaceRoom, + /** + * Whether the user is the last admin in the room. This helps clients + * better inform the user about the consequences of leaving the room. + */ + var `isLastAdmin`: kotlin.Boolean +) { + + companion object +} + +/** + * @suppress + */ +public object FfiConverterTypeLeaveSpaceRoom: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): LeaveSpaceRoom { + return LeaveSpaceRoom( + FfiConverterTypeSpaceRoom.read(buf), + FfiConverterBoolean.read(buf), + ) + } + + override fun allocationSize(value: LeaveSpaceRoom) = ( + FfiConverterTypeSpaceRoom.allocationSize(value.`spaceRoom`) + + FfiConverterBoolean.allocationSize(value.`isLastAdmin`) + ) + + override fun write(value: LeaveSpaceRoom, buf: ByteBuffer) { + FfiConverterTypeSpaceRoom.write(value.`spaceRoom`, buf) + FfiConverterBoolean.write(value.`isLastAdmin`, buf) + } +} + + + /** * Details of a users live location share. */ @@ -29384,7 +32458,11 @@ data class NotificationItem ( */ var `isNoisy`: kotlin.Boolean?, var `hasMention`: kotlin.Boolean?, - var `threadId`: kotlin.String? + var `threadId`: kotlin.String?, + /** + * The push actions for this notification (notify, sound, highlight, etc.). + */ + var `actions`: List? ) : Disposable { @Suppress("UNNECESSARY_SAFE_CALL") // codegen is much simpler if we unconditionally emit safe calls here @@ -29396,7 +32474,8 @@ data class NotificationItem ( this.`roomInfo`, this.`isNoisy`, this.`hasMention`, - this.`threadId` + this.`threadId`, + this.`actions` ) } @@ -29415,6 +32494,7 @@ public object FfiConverterTypeNotificationItem: FfiConverterRustBuffer { +/** + * Represents an emoji recently used for reactions. + */ +data class RecentEmoji ( + /** + * The actual emoji text representation. + */ + var `emoji`: kotlin.String, + /** + * The number of times this emoji has been used for reactions. + */ + var `count`: kotlin.ULong +) { + + companion object +} + +/** + * @suppress + */ +public object FfiConverterTypeRecentEmoji: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): RecentEmoji { + return RecentEmoji( + FfiConverterString.read(buf), + FfiConverterULong.read(buf), + ) + } + + override fun allocationSize(value: RecentEmoji) = ( + FfiConverterString.allocationSize(value.`emoji`) + + FfiConverterULong.allocationSize(value.`count`) + ) + + override fun write(value: RecentEmoji, buf: ByteBuffer) { + FfiConverterString.write(value.`emoji`, buf) + FfiConverterULong.write(value.`count`, buf) + } +} + + + /** * The config to use for HTTP requests by default in this client. */ @@ -30642,7 +33769,6 @@ data class RoomMember ( var `membership`: MembershipState, var `isNameAmbiguous`: kotlin.Boolean, var `powerLevel`: PowerLevel, - var `normalizedPowerLevel`: PowerLevel, var `isIgnored`: kotlin.Boolean, var `suggestedRoleForPowerLevel`: RoomMemberRole, var `membershipChangeReason`: kotlin.String? @@ -30663,7 +33789,6 @@ public object FfiConverterTypeRoomMember: FfiConverterRustBuffer { FfiConverterTypeMembershipState.read(buf), FfiConverterBoolean.read(buf), FfiConverterTypePowerLevel.read(buf), - FfiConverterTypePowerLevel.read(buf), FfiConverterBoolean.read(buf), FfiConverterTypeRoomMemberRole.read(buf), FfiConverterOptionalString.read(buf), @@ -30677,7 +33802,6 @@ public object FfiConverterTypeRoomMember: FfiConverterRustBuffer { FfiConverterTypeMembershipState.allocationSize(value.`membership`) + FfiConverterBoolean.allocationSize(value.`isNameAmbiguous`) + FfiConverterTypePowerLevel.allocationSize(value.`powerLevel`) + - FfiConverterTypePowerLevel.allocationSize(value.`normalizedPowerLevel`) + FfiConverterBoolean.allocationSize(value.`isIgnored`) + FfiConverterTypeRoomMemberRole.allocationSize(value.`suggestedRoleForPowerLevel`) + FfiConverterOptionalString.allocationSize(value.`membershipChangeReason`) @@ -30690,7 +33814,6 @@ public object FfiConverterTypeRoomMember: FfiConverterRustBuffer { FfiConverterTypeMembershipState.write(value.`membership`, buf) FfiConverterBoolean.write(value.`isNameAmbiguous`, buf) FfiConverterTypePowerLevel.write(value.`powerLevel`, buf) - FfiConverterTypePowerLevel.write(value.`normalizedPowerLevel`, buf) FfiConverterBoolean.write(value.`isIgnored`, buf) FfiConverterTypeRoomMemberRole.write(value.`suggestedRoleForPowerLevel`, buf) FfiConverterOptionalString.write(value.`membershipChangeReason`, buf) @@ -30827,7 +33950,11 @@ data class RoomPowerLevelsValues ( /** * The level required to change the room's topic. */ - var `roomTopic`: kotlin.Long + var `roomTopic`: kotlin.Long, + /** + * The level required to change the space's children. + */ + var `spaceChild`: kotlin.Long ) { companion object @@ -30849,6 +33976,7 @@ public object FfiConverterTypeRoomPowerLevelsValues: FfiConverterRustBuffer? + var `heroes`: List?, + /** + * The via parameters of the room. + */ + var `via`: List ) { companion object @@ -31396,6 +34542,7 @@ public object FfiConverterTypeSpaceRoom: FfiConverterRustBuffer { return SpaceRoom( FfiConverterString.read(buf), FfiConverterOptionalString.read(buf), + FfiConverterString.read(buf), FfiConverterOptionalString.read(buf), FfiConverterOptionalString.read(buf), FfiConverterOptionalString.read(buf), @@ -31404,16 +34551,19 @@ public object FfiConverterTypeSpaceRoom: FfiConverterRustBuffer { FfiConverterOptionalTypeJoinRule.read(buf), FfiConverterOptionalBoolean.read(buf), FfiConverterBoolean.read(buf), + FfiConverterOptionalBoolean.read(buf), FfiConverterULong.read(buf), FfiConverterOptionalTypeMembership.read(buf), FfiConverterOptionalSequenceTypeRoomHero.read(buf), + FfiConverterSequenceString.read(buf), ) } override fun allocationSize(value: SpaceRoom) = ( FfiConverterString.allocationSize(value.`roomId`) + FfiConverterOptionalString.allocationSize(value.`canonicalAlias`) + - FfiConverterOptionalString.allocationSize(value.`name`) + + FfiConverterString.allocationSize(value.`displayName`) + + FfiConverterOptionalString.allocationSize(value.`rawName`) + FfiConverterOptionalString.allocationSize(value.`topic`) + FfiConverterOptionalString.allocationSize(value.`avatarUrl`) + FfiConverterTypeRoomType.allocationSize(value.`roomType`) + @@ -31421,15 +34571,18 @@ public object FfiConverterTypeSpaceRoom: FfiConverterRustBuffer { FfiConverterOptionalTypeJoinRule.allocationSize(value.`joinRule`) + FfiConverterOptionalBoolean.allocationSize(value.`worldReadable`) + FfiConverterBoolean.allocationSize(value.`guestCanJoin`) + + FfiConverterOptionalBoolean.allocationSize(value.`isDirect`) + FfiConverterULong.allocationSize(value.`childrenCount`) + FfiConverterOptionalTypeMembership.allocationSize(value.`state`) + - FfiConverterOptionalSequenceTypeRoomHero.allocationSize(value.`heroes`) + FfiConverterOptionalSequenceTypeRoomHero.allocationSize(value.`heroes`) + + FfiConverterSequenceString.allocationSize(value.`via`) ) override fun write(value: SpaceRoom, buf: ByteBuffer) { FfiConverterString.write(value.`roomId`, buf) FfiConverterOptionalString.write(value.`canonicalAlias`, buf) - FfiConverterOptionalString.write(value.`name`, buf) + FfiConverterString.write(value.`displayName`, buf) + FfiConverterOptionalString.write(value.`rawName`, buf) FfiConverterOptionalString.write(value.`topic`, buf) FfiConverterOptionalString.write(value.`avatarUrl`, buf) FfiConverterTypeRoomType.write(value.`roomType`, buf) @@ -31437,9 +34590,67 @@ public object FfiConverterTypeSpaceRoom: FfiConverterRustBuffer { FfiConverterOptionalTypeJoinRule.write(value.`joinRule`, buf) FfiConverterOptionalBoolean.write(value.`worldReadable`, buf) FfiConverterBoolean.write(value.`guestCanJoin`, buf) + FfiConverterOptionalBoolean.write(value.`isDirect`, buf) FfiConverterULong.write(value.`childrenCount`, buf) FfiConverterOptionalTypeMembership.write(value.`state`, buf) FfiConverterOptionalSequenceTypeRoomHero.write(value.`heroes`, buf) + FfiConverterSequenceString.write(value.`via`, buf) + } +} + + + +/** + * Contains the disk size of the different stores, if known. It won't be + * available for in-memory stores. + */ +data class StoreSizes ( + /** + * The size of the CryptoStore. + */ + var `cryptoStore`: kotlin.ULong?, + /** + * The size of the StateStore. + */ + var `stateStore`: kotlin.ULong?, + /** + * The size of the EventCacheStore. + */ + var `eventCacheStore`: kotlin.ULong?, + /** + * The size of the MediaStore. + */ + var `mediaStore`: kotlin.ULong? +) { + + companion object +} + +/** + * @suppress + */ +public object FfiConverterTypeStoreSizes: FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): StoreSizes { + return StoreSizes( + FfiConverterOptionalULong.read(buf), + FfiConverterOptionalULong.read(buf), + FfiConverterOptionalULong.read(buf), + FfiConverterOptionalULong.read(buf), + ) + } + + override fun allocationSize(value: StoreSizes) = ( + FfiConverterOptionalULong.allocationSize(value.`cryptoStore`) + + FfiConverterOptionalULong.allocationSize(value.`stateStore`) + + FfiConverterOptionalULong.allocationSize(value.`eventCacheStore`) + + FfiConverterOptionalULong.allocationSize(value.`mediaStore`) + ) + + override fun write(value: StoreSizes, buf: ByteBuffer) { + FfiConverterOptionalULong.write(value.`cryptoStore`, buf) + FfiConverterOptionalULong.write(value.`stateStore`, buf) + FfiConverterOptionalULong.write(value.`eventCacheStore`, buf) + FfiConverterOptionalULong.write(value.`mediaStore`, buf) } } @@ -31657,12 +34868,12 @@ data class TimelineConfiguration ( var `dateDividerMode`: DateDividerMode, /** * Should the read receipts and read markers be tracked for the timeline - * items in this instance? + * items in this instance and on which event types? * * As this has a non negligible performance impact, make sure to enable it * only when you need it. */ - var `trackReadReceipts`: kotlin.Boolean, + var `trackReadReceipts`: TimelineReadReceiptTracking, /** * Whether this timeline instance should report UTDs through the client's * delegate. @@ -31696,7 +34907,7 @@ public object FfiConverterTypeTimelineConfiguration: FfiConverterRustBuffer