Skip to content

Commit 8f9251b

Browse files
committed
Bump to version 25.05.27 (matrix-rust-sdk/main 7531167824b498e6fcbbaa21a09040458a9174eb)
1 parent ac83025 commit 8f9251b

File tree

2 files changed

+123
-14
lines changed

2 files changed

+123
-14
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 = "983479e1acc0cd484118c68ffb0551e914217adc57582208938c9b7045de8436"
5-
let version = "25.05.26-2"
4+
let checksum = "7b076435cd0da6d0877cf1de76528631adc2b3c2405ed754683ae30ece58e8a6"
5+
let version = "25.05.27"
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: 121 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,15 @@ public protocol ClientProtocol : AnyObject {
633633
/**
634634
* Clear all the non-critical caches for this Client instance.
635635
*
636+
* WARNING: This will clear all the caches, including the base store (state
637+
* store), so callers must make sure that any sync is inactive before
638+
* calling this method. In particular, the `SyncService` must not be
639+
* running. After the method returns, the Client will be in an unstable
640+
* state, and it is required that the caller reinstantiates a new
641+
* Client instance, be it via dropping the previous and re-creating it,
642+
* restarting their application, or any other similar means.
643+
*
644+
* - This will get rid of the backing state store file, if provided.
636645
* - This will empty all the room's persisted event caches, so all rooms
637646
* will start as if they were empty.
638647
* - This will empty the media cache according to the current media
@@ -685,13 +694,18 @@ public protocol ClientProtocol : AnyObject {
685694

686695
func encryption() -> Encryption
687696

697+
/**
698+
* Fetch the media preview configuration from the server.
699+
*/
700+
func fetchMediaPreviewConfig() async throws -> MediaPreviewConfig?
701+
688702
func getDmRoom(userId: String) throws -> Room?
689703

690704
/**
691705
* Get the invite request avatars display policy
692706
* currently stored in the cache.
693707
*/
694-
func getInviteAvatarsDisplayPolicy() async throws -> InviteAvatars
708+
func getInviteAvatarsDisplayPolicy() async throws -> InviteAvatars?
695709

696710
func getMediaContent(mediaSource: MediaSource) async throws -> Data
697711

@@ -701,7 +715,7 @@ public protocol ClientProtocol : AnyObject {
701715
* Get the media previews timeline display policy
702716
* currently stored in the cache.
703717
*/
704-
func getMediaPreviewDisplayPolicy() async throws -> MediaPreviews
718+
func getMediaPreviewDisplayPolicy() async throws -> MediaPreviews?
705719

706720
func getMediaThumbnail(mediaSource: MediaSource, width: UInt64, height: UInt64) async throws -> Data
707721

@@ -1224,6 +1238,15 @@ open func canDeactivateAccount() -> Bool {
12241238
/**
12251239
* Clear all the non-critical caches for this Client instance.
12261240
*
1241+
* WARNING: This will clear all the caches, including the base store (state
1242+
* store), so callers must make sure that any sync is inactive before
1243+
* calling this method. In particular, the `SyncService` must not be
1244+
* running. After the method returns, the Client will be in an unstable
1245+
* state, and it is required that the caller reinstantiates a new
1246+
* Client instance, be it via dropping the previous and re-creating it,
1247+
* restarting their application, or any other similar means.
1248+
*
1249+
* - This will get rid of the backing state store file, if provided.
12271250
* - This will empty all the room's persisted event caches, so all rooms
12281251
* will start as if they were empty.
12291252
* - This will empty the media cache according to the current media
@@ -1392,6 +1415,26 @@ open func encryption() -> Encryption {
13921415
})
13931416
}
13941417

1418+
/**
1419+
* Fetch the media preview configuration from the server.
1420+
*/
1421+
open func fetchMediaPreviewConfig()async throws -> MediaPreviewConfig? {
1422+
return
1423+
try await uniffiRustCallAsync(
1424+
rustFutureFunc: {
1425+
uniffi_matrix_sdk_ffi_fn_method_client_fetch_media_preview_config(
1426+
self.uniffiClonePointer()
1427+
1428+
)
1429+
},
1430+
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer,
1431+
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer,
1432+
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_rust_buffer,
1433+
liftFunc: FfiConverterOptionTypeMediaPreviewConfig.lift,
1434+
errorHandler: FfiConverterTypeClientError.lift
1435+
)
1436+
}
1437+
13951438
open func getDmRoom(userId: String)throws -> Room? {
13961439
return try FfiConverterOptionTypeRoom.lift(try rustCallWithError(FfiConverterTypeClientError.lift) {
13971440
uniffi_matrix_sdk_ffi_fn_method_client_get_dm_room(self.uniffiClonePointer(),
@@ -1404,7 +1447,7 @@ open func getDmRoom(userId: String)throws -> Room? {
14041447
* Get the invite request avatars display policy
14051448
* currently stored in the cache.
14061449
*/
1407-
open func getInviteAvatarsDisplayPolicy()async throws -> InviteAvatars {
1450+
open func getInviteAvatarsDisplayPolicy()async throws -> InviteAvatars? {
14081451
return
14091452
try await uniffiRustCallAsync(
14101453
rustFutureFunc: {
@@ -1416,7 +1459,7 @@ open func getInviteAvatarsDisplayPolicy()async throws -> InviteAvatars {
14161459
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer,
14171460
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer,
14181461
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_rust_buffer,
1419-
liftFunc: FfiConverterTypeInviteAvatars.lift,
1462+
liftFunc: FfiConverterOptionTypeInviteAvatars.lift,
14201463
errorHandler: FfiConverterTypeClientError.lift
14211464
)
14221465
}
@@ -1459,7 +1502,7 @@ open func getMediaFile(mediaSource: MediaSource, filename: String?, mimeType: St
14591502
* Get the media previews timeline display policy
14601503
* currently stored in the cache.
14611504
*/
1462-
open func getMediaPreviewDisplayPolicy()async throws -> MediaPreviews {
1505+
open func getMediaPreviewDisplayPolicy()async throws -> MediaPreviews? {
14631506
return
14641507
try await uniffiRustCallAsync(
14651508
rustFutureFunc: {
@@ -1471,7 +1514,7 @@ open func getMediaPreviewDisplayPolicy()async throws -> MediaPreviews {
14711514
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer,
14721515
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer,
14731516
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_rust_buffer,
1474-
liftFunc: FfiConverterTypeMediaPreviews.lift,
1517+
liftFunc: FfiConverterOptionTypeMediaPreviews.lift,
14751518
errorHandler: FfiConverterTypeClientError.lift
14761519
)
14771520
}
@@ -31536,7 +31579,7 @@ extension FfiConverterCallbackInterfaceLiveLocationShareListener : FfiConverter
3153631579

3153731580
public protocol MediaPreviewConfigListener : AnyObject {
3153831581

31539-
func onChange(mediaPreviewConfig: MediaPreviewConfig)
31582+
func onChange(mediaPreviewConfig: MediaPreviewConfig?)
3154031583

3154131584
}
3154231585

@@ -31560,7 +31603,7 @@ fileprivate struct UniffiCallbackInterfaceMediaPreviewConfigListener {
3156031603
throw UniffiInternalError.unexpectedStaleHandle
3156131604
}
3156231605
return uniffiObj.onChange(
31563-
mediaPreviewConfig: try FfiConverterTypeMediaPreviewConfig.lift(mediaPreviewConfig)
31606+
mediaPreviewConfig: try FfiConverterOptionTypeMediaPreviewConfig.lift(mediaPreviewConfig)
3156431607
)
3156531608
}
3156631609

@@ -33984,6 +34027,27 @@ fileprivate struct FfiConverterOptionTypeMatrixEntity: FfiConverterRustBuffer {
3398434027
}
3398534028
}
3398634029

34030+
fileprivate struct FfiConverterOptionTypeMediaPreviewConfig: FfiConverterRustBuffer {
34031+
typealias SwiftType = MediaPreviewConfig?
34032+
34033+
public static func write(_ value: SwiftType, into buf: inout [UInt8]) {
34034+
guard let value = value else {
34035+
writeInt(&buf, Int8(0))
34036+
return
34037+
}
34038+
writeInt(&buf, Int8(1))
34039+
FfiConverterTypeMediaPreviewConfig.write(value, into: &buf)
34040+
}
34041+
34042+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType {
34043+
switch try readInt(&buf) as Int8 {
34044+
case 0: return nil
34045+
case 1: return try FfiConverterTypeMediaPreviewConfig.read(from: &buf)
34046+
default: throw UniffiInternalError.unexpectedOptionalTag
34047+
}
34048+
}
34049+
}
34050+
3398734051
fileprivate struct FfiConverterOptionTypeMentions: FfiConverterRustBuffer {
3398834052
typealias SwiftType = Mentions?
3398934053

@@ -34425,6 +34489,27 @@ fileprivate struct FfiConverterOptionTypeIntent: FfiConverterRustBuffer {
3442534489
}
3442634490
}
3442734491

34492+
fileprivate struct FfiConverterOptionTypeInviteAvatars: FfiConverterRustBuffer {
34493+
typealias SwiftType = InviteAvatars?
34494+
34495+
public static func write(_ value: SwiftType, into buf: inout [UInt8]) {
34496+
guard let value = value else {
34497+
writeInt(&buf, Int8(0))
34498+
return
34499+
}
34500+
writeInt(&buf, Int8(1))
34501+
FfiConverterTypeInviteAvatars.write(value, into: &buf)
34502+
}
34503+
34504+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType {
34505+
switch try readInt(&buf) as Int8 {
34506+
case 0: return nil
34507+
case 1: return try FfiConverterTypeInviteAvatars.read(from: &buf)
34508+
default: throw UniffiInternalError.unexpectedOptionalTag
34509+
}
34510+
}
34511+
}
34512+
3442834513
fileprivate struct FfiConverterOptionTypeJoinRule: FfiConverterRustBuffer {
3442934514
typealias SwiftType = JoinRule?
3443034515

@@ -34446,6 +34531,27 @@ fileprivate struct FfiConverterOptionTypeJoinRule: FfiConverterRustBuffer {
3444634531
}
3444734532
}
3444834533

34534+
fileprivate struct FfiConverterOptionTypeMediaPreviews: FfiConverterRustBuffer {
34535+
typealias SwiftType = MediaPreviews?
34536+
34537+
public static func write(_ value: SwiftType, into buf: inout [UInt8]) {
34538+
guard let value = value else {
34539+
writeInt(&buf, Int8(0))
34540+
return
34541+
}
34542+
writeInt(&buf, Int8(1))
34543+
FfiConverterTypeMediaPreviews.write(value, into: &buf)
34544+
}
34545+
34546+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType {
34547+
switch try readInt(&buf) as Int8 {
34548+
case 0: return nil
34549+
case 1: return try FfiConverterTypeMediaPreviews.read(from: &buf)
34550+
default: throw UniffiInternalError.unexpectedOptionalTag
34551+
}
34552+
}
34553+
}
34554+
3444934555
fileprivate struct FfiConverterOptionTypeMembership: FfiConverterRustBuffer {
3445034556
typealias SwiftType = Membership?
3445134557

@@ -36341,7 +36447,7 @@ private var initializationResult: InitializationResult = {
3634136447
if (uniffi_matrix_sdk_ffi_checksum_method_client_can_deactivate_account() != 39890) {
3634236448
return InitializationResult.apiChecksumMismatch
3634336449
}
36344-
if (uniffi_matrix_sdk_ffi_checksum_method_client_clear_caches() != 47085) {
36450+
if (uniffi_matrix_sdk_ffi_checksum_method_client_clear_caches() != 65177) {
3634536451
return InitializationResult.apiChecksumMismatch
3634636452
}
3634736453
if (uniffi_matrix_sdk_ffi_checksum_method_client_create_room() != 52700) {
@@ -36368,10 +36474,13 @@ private var initializationResult: InitializationResult = {
3636836474
if (uniffi_matrix_sdk_ffi_checksum_method_client_encryption() != 9657) {
3636936475
return InitializationResult.apiChecksumMismatch
3637036476
}
36477+
if (uniffi_matrix_sdk_ffi_checksum_method_client_fetch_media_preview_config() != 15595) {
36478+
return InitializationResult.apiChecksumMismatch
36479+
}
3637136480
if (uniffi_matrix_sdk_ffi_checksum_method_client_get_dm_room() != 5137) {
3637236481
return InitializationResult.apiChecksumMismatch
3637336482
}
36374-
if (uniffi_matrix_sdk_ffi_checksum_method_client_get_invite_avatars_display_policy() != 3997) {
36483+
if (uniffi_matrix_sdk_ffi_checksum_method_client_get_invite_avatars_display_policy() != 46953) {
3637536484
return InitializationResult.apiChecksumMismatch
3637636485
}
3637736486
if (uniffi_matrix_sdk_ffi_checksum_method_client_get_media_content() != 40308) {
@@ -36380,7 +36489,7 @@ private var initializationResult: InitializationResult = {
3638036489
if (uniffi_matrix_sdk_ffi_checksum_method_client_get_media_file() != 52604) {
3638136490
return InitializationResult.apiChecksumMismatch
3638236491
}
36383-
if (uniffi_matrix_sdk_ffi_checksum_method_client_get_media_preview_display_policy() != 55631) {
36492+
if (uniffi_matrix_sdk_ffi_checksum_method_client_get_media_preview_display_policy() != 19264) {
3638436493
return InitializationResult.apiChecksumMismatch
3638536494
}
3638636495
if (uniffi_matrix_sdk_ffi_checksum_method_client_get_media_thumbnail() != 52601) {
@@ -37532,7 +37641,7 @@ private var initializationResult: InitializationResult = {
3753237641
if (uniffi_matrix_sdk_ffi_checksum_method_livelocationsharelistener_call() != 34519) {
3753337642
return InitializationResult.apiChecksumMismatch
3753437643
}
37535-
if (uniffi_matrix_sdk_ffi_checksum_method_mediapreviewconfiglistener_on_change() != 42142) {
37644+
if (uniffi_matrix_sdk_ffi_checksum_method_mediapreviewconfiglistener_on_change() != 14770) {
3753637645
return InitializationResult.apiChecksumMismatch
3753737646
}
3753837647
if (uniffi_matrix_sdk_ffi_checksum_method_notificationsettingsdelegate_settings_did_change() != 51708) {

0 commit comments

Comments
 (0)