Skip to content

Commit 2c54951

Browse files
committed
Bump to version 25.12.03 (matrix-rust-sdk/main 93f71ba9777edb2b6816dd958c2f4e50a4879f90)
1 parent 059bf9d commit 2c54951

File tree

2 files changed

+205
-13
lines changed

2 files changed

+205
-13
lines changed

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// swift-tools-version:5.9
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33
import PackageDescription
4-
let checksum = "dfd191a34316681509fdcd391502ab1719caa6f88f5931c436021b43fbe83ff4"
5-
let version = "25.12.02"
4+
let checksum = "fbf2170ebec047ee80acdfbdc79a88cd9c8dd0b37e71fb458b28b262ab6cebc5"
5+
let version = "25.12.03"
66
let url = "https://github.com/element-hq/matrix-rust-components-swift/releases/download/\(version)/MatrixSDKFFI.xcframework.zip"
77
let package = Package(
88
name: "MatrixRustSDK",

Sources/MatrixRustSDK/matrix_sdk_ffi.swift

Lines changed: 203 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,11 @@ public protocol ClientProtocol: AnyObject, Sendable {
10281028

10291029
func getSessionVerificationController() async throws -> SessionVerificationController
10301030

1031+
/**
1032+
* Returns the sizes of the existing stores, if known.
1033+
*/
1034+
func getStoreSizes() async throws -> StoreSizes
1035+
10311036
/**
10321037
* Allows generic GET requests to be made through the SDK's internal HTTP
10331038
* client. This is useful when the caller's native HTTP client wouldn't
@@ -1059,6 +1064,11 @@ public protocol ClientProtocol: AnyObject, Sendable {
10591064
*/
10601065
func isLivekitRtcSupported() async throws -> Bool
10611066

1067+
/**
1068+
* Checks if the server supports login using a QR code.
1069+
*/
1070+
func isLoginWithQrCodeSupported() async throws -> Bool
1071+
10621072
/**
10631073
* Checks if the server supports the report room API.
10641074
*/
@@ -1156,6 +1166,12 @@ public protocol ClientProtocol: AnyObject, Sendable {
11561166
*/
11571167
func observeRoomAccountDataEvent(roomId: String, eventType: RoomAccountDataEventType, listener: RoomAccountDataListener) throws -> TaskHandle
11581168

1169+
/**
1170+
* Perform database optimizations if any are available, i.e. vacuuming in
1171+
* SQLite.
1172+
*/
1173+
func optimizeStores() async throws
1174+
11591175
/**
11601176
* Register a handler for notifications generated from sync responses.
11611177
*
@@ -2138,6 +2154,26 @@ open func getSessionVerificationController()async throws -> SessionVerification
21382154
)
21392155
}
21402156

2157+
/**
2158+
* Returns the sizes of the existing stores, if known.
2159+
*/
2160+
open func getStoreSizes()async throws -> StoreSizes {
2161+
return
2162+
try await uniffiRustCallAsync(
2163+
rustFutureFunc: {
2164+
uniffi_matrix_sdk_ffi_fn_method_client_get_store_sizes(
2165+
self.uniffiCloneHandle()
2166+
2167+
)
2168+
},
2169+
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer,
2170+
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer,
2171+
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_rust_buffer,
2172+
liftFunc: FfiConverterTypeStoreSizes_lift,
2173+
errorHandler: FfiConverterTypeClientError_lift
2174+
)
2175+
}
2176+
21412177
/**
21422178
* Allows generic GET requests to be made through the SDK's internal HTTP
21432179
* client. This is useful when the caller's native HTTP client wouldn't
@@ -2251,6 +2287,26 @@ open func isLivekitRtcSupported()async throws -> Bool {
22512287
)
22522288
}
22532289

2290+
/**
2291+
* Checks if the server supports login using a QR code.
2292+
*/
2293+
open func isLoginWithQrCodeSupported()async throws -> Bool {
2294+
return
2295+
try await uniffiRustCallAsync(
2296+
rustFutureFunc: {
2297+
uniffi_matrix_sdk_ffi_fn_method_client_is_login_with_qr_code_supported(
2298+
self.uniffiCloneHandle()
2299+
2300+
)
2301+
},
2302+
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_i8,
2303+
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_i8,
2304+
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_i8,
2305+
liftFunc: FfiConverterBool.lift,
2306+
errorHandler: FfiConverterTypeClientError_lift
2307+
)
2308+
}
2309+
22542310
/**
22552311
* Checks if the server supports the report room API.
22562312
*/
@@ -2528,6 +2584,27 @@ open func observeRoomAccountDataEvent(roomId: String, eventType: RoomAccountData
25282584
})
25292585
}
25302586

2587+
/**
2588+
* Perform database optimizations if any are available, i.e. vacuuming in
2589+
* SQLite.
2590+
*/
2591+
open func optimizeStores()async throws {
2592+
return
2593+
try await uniffiRustCallAsync(
2594+
rustFutureFunc: {
2595+
uniffi_matrix_sdk_ffi_fn_method_client_optimize_stores(
2596+
self.uniffiCloneHandle()
2597+
2598+
)
2599+
},
2600+
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_void,
2601+
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_void,
2602+
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_void,
2603+
liftFunc: { $0 },
2604+
errorHandler: FfiConverterTypeClientError_lift
2605+
)
2606+
}
2607+
25312608
/**
25322609
* Register a handler for notifications generated from sync responses.
25332610
*
@@ -14308,12 +14385,21 @@ public protocol TimelineProtocol: AnyObject, Sendable {
1430814385
func loadReplyDetails(eventIdStr: String) async throws -> InReplyToDetails
1430914386

1431014387
/**
14311-
* Mark the room as read by trying to attach an *unthreaded* read receipt
14312-
* to the latest room event.
14388+
* Mark the timeline as read by attempting to send a read receipt on the
14389+
* latest visible event.
14390+
*
14391+
* The latest visible event is determined from the timeline's focus kind
14392+
* and whether or not it hides threaded events. If no latest event can
14393+
* be determined and the timeline is live, the room's unread marker is
14394+
* unset instead.
1431314395
*
14314-
* This works even if the latest event belongs to a thread, as a threaded
14315-
* reply also belongs to the unthreaded timeline. No threaded receipt
14316-
* will be sent here (see also #3123).
14396+
* # Arguments
14397+
*
14398+
* * `receipt_type` - The type of receipt to send. When using
14399+
* [`ReceiptType::FullyRead`], an unthreaded receipt will be sent. This
14400+
* works even if the latest event belongs to a thread, as a threaded
14401+
* reply also belongs to the unthreaded timeline. Otherwise the receipt
14402+
* thread will be determined based on the timeline's focus kind.
1431714403
*/
1431814404
func markAsRead(receiptType: ReceiptType) async throws
1431914405

@@ -14664,12 +14750,21 @@ open func loadReplyDetails(eventIdStr: String)async throws -> InReplyToDetails
1466414750
}
1466514751

1466614752
/**
14667-
* Mark the room as read by trying to attach an *unthreaded* read receipt
14668-
* to the latest room event.
14753+
* Mark the timeline as read by attempting to send a read receipt on the
14754+
* latest visible event.
14755+
*
14756+
* The latest visible event is determined from the timeline's focus kind
14757+
* and whether or not it hides threaded events. If no latest event can
14758+
* be determined and the timeline is live, the room's unread marker is
14759+
* unset instead.
14760+
*
14761+
* # Arguments
1466914762
*
14670-
* This works even if the latest event belongs to a thread, as a threaded
14671-
* reply also belongs to the unthreaded timeline. No threaded receipt
14672-
* will be sent here (see also #3123).
14763+
* * `receipt_type` - The type of receipt to send. When using
14764+
* [`ReceiptType::FullyRead`], an unthreaded receipt will be sent. This
14765+
* works even if the latest event belongs to a thread, as a threaded
14766+
* reply also belongs to the unthreaded timeline. Otherwise the receipt
14767+
* thread will be determined based on the timeline's focus kind.
1467314768
*/
1467414769
open func markAsRead(receiptType: ReceiptType)async throws {
1467514770
return
@@ -21745,6 +21840,94 @@ public func FfiConverterTypeSpaceRoom_lower(_ value: SpaceRoom) -> RustBuffer {
2174521840
}
2174621841

2174721842

21843+
/**
21844+
* Contains the disk size of the different stores, if known. It won't be
21845+
* available for in-memory stores.
21846+
*/
21847+
public struct StoreSizes: Equatable, Hashable {
21848+
/**
21849+
* The size of the CryptoStore.
21850+
*/
21851+
public var cryptoStore: UInt64?
21852+
/**
21853+
* The size of the StateStore.
21854+
*/
21855+
public var stateStore: UInt64?
21856+
/**
21857+
* The size of the EventCacheStore.
21858+
*/
21859+
public var eventCacheStore: UInt64?
21860+
/**
21861+
* The size of the MediaStore.
21862+
*/
21863+
public var mediaStore: UInt64?
21864+
21865+
// Default memberwise initializers are never public by default, so we
21866+
// declare one manually.
21867+
public init(
21868+
/**
21869+
* The size of the CryptoStore.
21870+
*/cryptoStore: UInt64?,
21871+
/**
21872+
* The size of the StateStore.
21873+
*/stateStore: UInt64?,
21874+
/**
21875+
* The size of the EventCacheStore.
21876+
*/eventCacheStore: UInt64?,
21877+
/**
21878+
* The size of the MediaStore.
21879+
*/mediaStore: UInt64?) {
21880+
self.cryptoStore = cryptoStore
21881+
self.stateStore = stateStore
21882+
self.eventCacheStore = eventCacheStore
21883+
self.mediaStore = mediaStore
21884+
}
21885+
21886+
21887+
}
21888+
21889+
#if compiler(>=6)
21890+
extension StoreSizes: Sendable {}
21891+
#endif
21892+
21893+
#if swift(>=5.8)
21894+
@_documentation(visibility: private)
21895+
#endif
21896+
public struct FfiConverterTypeStoreSizes: FfiConverterRustBuffer {
21897+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> StoreSizes {
21898+
return
21899+
try StoreSizes(
21900+
cryptoStore: FfiConverterOptionUInt64.read(from: &buf),
21901+
stateStore: FfiConverterOptionUInt64.read(from: &buf),
21902+
eventCacheStore: FfiConverterOptionUInt64.read(from: &buf),
21903+
mediaStore: FfiConverterOptionUInt64.read(from: &buf)
21904+
)
21905+
}
21906+
21907+
public static func write(_ value: StoreSizes, into buf: inout [UInt8]) {
21908+
FfiConverterOptionUInt64.write(value.cryptoStore, into: &buf)
21909+
FfiConverterOptionUInt64.write(value.stateStore, into: &buf)
21910+
FfiConverterOptionUInt64.write(value.eventCacheStore, into: &buf)
21911+
FfiConverterOptionUInt64.write(value.mediaStore, into: &buf)
21912+
}
21913+
}
21914+
21915+
21916+
#if swift(>=5.8)
21917+
@_documentation(visibility: private)
21918+
#endif
21919+
public func FfiConverterTypeStoreSizes_lift(_ buf: RustBuffer) throws -> StoreSizes {
21920+
return try FfiConverterTypeStoreSizes.lift(buf)
21921+
}
21922+
21923+
#if swift(>=5.8)
21924+
@_documentation(visibility: private)
21925+
#endif
21926+
public func FfiConverterTypeStoreSizes_lower(_ value: StoreSizes) -> RustBuffer {
21927+
return FfiConverterTypeStoreSizes.lower(value)
21928+
}
21929+
21930+
2174821931
/**
2174921932
* When a room A is tombstoned, it is replaced by a room B. The room A is the
2175021933
* predecessor of B, and B is the successor of A. This type holds information
@@ -45389,6 +45572,9 @@ private let initializationResult: InitializationResult = {
4538945572
if (uniffi_matrix_sdk_ffi_checksum_method_client_get_session_verification_controller() != 55934) {
4539045573
return InitializationResult.apiChecksumMismatch
4539145574
}
45575+
if (uniffi_matrix_sdk_ffi_checksum_method_client_get_store_sizes() != 30209) {
45576+
return InitializationResult.apiChecksumMismatch
45577+
}
4539245578
if (uniffi_matrix_sdk_ffi_checksum_method_client_get_url() != 32541) {
4539345579
return InitializationResult.apiChecksumMismatch
4539445580
}
@@ -45407,6 +45593,9 @@ private let initializationResult: InitializationResult = {
4540745593
if (uniffi_matrix_sdk_ffi_checksum_method_client_is_livekit_rtc_supported() != 34863) {
4540845594
return InitializationResult.apiChecksumMismatch
4540945595
}
45596+
if (uniffi_matrix_sdk_ffi_checksum_method_client_is_login_with_qr_code_supported() != 17812) {
45597+
return InitializationResult.apiChecksumMismatch
45598+
}
4541045599
if (uniffi_matrix_sdk_ffi_checksum_method_client_is_report_room_api_supported() != 17934) {
4541145600
return InitializationResult.apiChecksumMismatch
4541245601
}
@@ -45449,6 +45638,9 @@ private let initializationResult: InitializationResult = {
4544945638
if (uniffi_matrix_sdk_ffi_checksum_method_client_observe_room_account_data_event() != 15699) {
4545045639
return InitializationResult.apiChecksumMismatch
4545145640
}
45641+
if (uniffi_matrix_sdk_ffi_checksum_method_client_optimize_stores() != 18852) {
45642+
return InitializationResult.apiChecksumMismatch
45643+
}
4545245644
if (uniffi_matrix_sdk_ffi_checksum_method_client_register_notification_handler() != 47103) {
4545345645
return InitializationResult.apiChecksumMismatch
4545445646
}
@@ -46502,7 +46694,7 @@ private let initializationResult: InitializationResult = {
4650246694
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_load_reply_details() != 54225) {
4650346695
return InitializationResult.apiChecksumMismatch
4650446696
}
46505-
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_mark_as_read() != 16621) {
46697+
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_mark_as_read() != 20604) {
4650646698
return InitializationResult.apiChecksumMismatch
4650746699
}
4650846700
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_paginate_backwards() != 36829) {

0 commit comments

Comments
 (0)