Skip to content

Commit 14fc58e

Browse files
committed
Bump to version v1.0.79 (matrix-rust-sdk/main d5e7a9c)
1 parent b4705d9 commit 14fc58e

File tree

2 files changed

+193
-12
lines changed

2 files changed

+193
-12
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 = "07d1f941378b9c65399028dea96a0b2673bc7bf281b7de7d7c7284a1142e4549"
5-
let version = "v1.0.78"
4+
let checksum = "b953d07db296ab710efb422f1e1808266ad768c1663df03a1a2b6fbacb17c97d"
5+
let version = "v1.0.79"
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: 191 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2241,6 +2241,21 @@ public protocol ClientBuilderProtocol : AnyObject {
22412241

22422242
func slidingSyncVersionBuilder(versionBuilder: SlidingSyncVersionBuilder) -> ClientBuilder
22432243

2244+
/**
2245+
* Whether to use the event cache persistent storage or not.
2246+
*
2247+
* This is a temporary feature flag, for testing the event cache's
2248+
* persistent storage. Follow new developments in https://github.com/matrix-org/matrix-rust-sdk/issues/3280.
2249+
*
2250+
* This is disabled by default. When disabled, a one-time cleanup is
2251+
* performed when creating the client, and it will clear all the events
2252+
* previously stored in the event cache.
2253+
*
2254+
* When enabled, it will attempt to store events in the event cache as
2255+
* they're received, and reuse them when reconstructing timelines.
2256+
*/
2257+
func useEventCachePersistentStorage(value: Bool) -> ClientBuilder
2258+
22442259
func userAgent(userAgent: String) -> ClientBuilder
22452260

22462261
func username(username: String) -> ClientBuilder
@@ -2530,6 +2545,27 @@ open func slidingSyncVersionBuilder(versionBuilder: SlidingSyncVersionBuilder) -
25302545
FfiConverterTypeSlidingSyncVersionBuilder.lower(versionBuilder),$0
25312546
)
25322547
})
2548+
}
2549+
2550+
/**
2551+
* Whether to use the event cache persistent storage or not.
2552+
*
2553+
* This is a temporary feature flag, for testing the event cache's
2554+
* persistent storage. Follow new developments in https://github.com/matrix-org/matrix-rust-sdk/issues/3280.
2555+
*
2556+
* This is disabled by default. When disabled, a one-time cleanup is
2557+
* performed when creating the client, and it will clear all the events
2558+
* previously stored in the event cache.
2559+
*
2560+
* When enabled, it will attempt to store events in the event cache as
2561+
* they're received, and reuse them when reconstructing timelines.
2562+
*/
2563+
open func useEventCachePersistentStorage(value: Bool) -> ClientBuilder {
2564+
return try! FfiConverterTypeClientBuilder.lift(try! rustCall() {
2565+
uniffi_matrix_sdk_ffi_fn_method_clientbuilder_use_event_cache_persistent_storage(self.uniffiClonePointer(),
2566+
FfiConverterBool.lower(value),$0
2567+
)
2568+
})
25332569
}
25342570

25352571
open func userAgent(userAgent: String) -> ClientBuilder {
@@ -4890,6 +4926,14 @@ public protocol RoomProtocol : AnyObject {
48904926
*/
48914927
func clearComposerDraft() async throws
48924928

4929+
/**
4930+
* Clear the event cache storage for the current room.
4931+
*
4932+
* This will remove all the information related to the event cache, in
4933+
* memory and in the persisted storage, if enabled.
4934+
*/
4935+
func clearEventCacheStorage() async throws
4936+
48934937
/**
48944938
* Forces the currently active room key, which is used to encrypt messages,
48954939
* to be rotated.
@@ -5048,7 +5092,7 @@ public protocol RoomProtocol : AnyObject {
50485092
* * `allowed_message_types` - A list of `RoomMessageEventMessageType` that
50495093
* will be allowed to appear in the timeline
50505094
*/
5051-
func messageFilteredTimeline(internalIdPrefix: String?, allowedMessageTypes: [RoomMessageEventMessageType]) async throws -> Timeline
5095+
func messageFilteredTimeline(internalIdPrefix: String?, allowedMessageTypes: [RoomMessageEventMessageType], dateDividerMode: DateDividerMode) async throws -> Timeline
50525096

50535097
func ownUserId() -> String
50545098

@@ -5128,6 +5172,17 @@ public protocol RoomProtocol : AnyObject {
51285172
*/
51295173
func sendCallNotificationIfNeeded() async throws
51305174

5175+
/**
5176+
* Send a raw event to the room.
5177+
*
5178+
* # Arguments
5179+
*
5180+
* * `event_type` - The type of the event to send.
5181+
*
5182+
* * `content` - The content of the event to send encoded as JSON string.
5183+
*/
5184+
func sendRaw(eventType: String, content: String) async throws
5185+
51315186
func setIsFavourite(isFavourite: Bool, tagOrder: Double?) async throws
51325187

51335188
func setIsLowPriority(isLowPriority: Bool, tagOrder: Double?) async throws
@@ -5500,6 +5555,29 @@ open func clearComposerDraft()async throws {
55005555
)
55015556
}
55025557

5558+
/**
5559+
* Clear the event cache storage for the current room.
5560+
*
5561+
* This will remove all the information related to the event cache, in
5562+
* memory and in the persisted storage, if enabled.
5563+
*/
5564+
open func clearEventCacheStorage()async throws {
5565+
return
5566+
try await uniffiRustCallAsync(
5567+
rustFutureFunc: {
5568+
uniffi_matrix_sdk_ffi_fn_method_room_clear_event_cache_storage(
5569+
self.uniffiClonePointer()
5570+
5571+
)
5572+
},
5573+
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_void,
5574+
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_void,
5575+
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_void,
5576+
liftFunc: { $0 },
5577+
errorHandler: FfiConverterTypeClientError.lift
5578+
)
5579+
}
5580+
55035581
/**
55045582
* Forces the currently active room key, which is used to encrypt messages,
55055583
* to be rotated.
@@ -6014,13 +6092,13 @@ open func membership() -> Membership {
60146092
* * `allowed_message_types` - A list of `RoomMessageEventMessageType` that
60156093
* will be allowed to appear in the timeline
60166094
*/
6017-
open func messageFilteredTimeline(internalIdPrefix: String?, allowedMessageTypes: [RoomMessageEventMessageType])async throws -> Timeline {
6095+
open func messageFilteredTimeline(internalIdPrefix: String?, allowedMessageTypes: [RoomMessageEventMessageType], dateDividerMode: DateDividerMode)async throws -> Timeline {
60186096
return
60196097
try await uniffiRustCallAsync(
60206098
rustFutureFunc: {
60216099
uniffi_matrix_sdk_ffi_fn_method_room_message_filtered_timeline(
60226100
self.uniffiClonePointer(),
6023-
FfiConverterOptionString.lower(internalIdPrefix),FfiConverterSequenceTypeRoomMessageEventMessageType.lower(allowedMessageTypes)
6101+
FfiConverterOptionString.lower(internalIdPrefix),FfiConverterSequenceTypeRoomMessageEventMessageType.lower(allowedMessageTypes),FfiConverterTypeDateDividerMode.lower(dateDividerMode)
60246102
)
60256103
},
60266104
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_pointer,
@@ -6254,6 +6332,32 @@ open func sendCallNotificationIfNeeded()async throws {
62546332
)
62556333
}
62566334

6335+
/**
6336+
* Send a raw event to the room.
6337+
*
6338+
* # Arguments
6339+
*
6340+
* * `event_type` - The type of the event to send.
6341+
*
6342+
* * `content` - The content of the event to send encoded as JSON string.
6343+
*/
6344+
open func sendRaw(eventType: String, content: String)async throws {
6345+
return
6346+
try await uniffiRustCallAsync(
6347+
rustFutureFunc: {
6348+
uniffi_matrix_sdk_ffi_fn_method_room_send_raw(
6349+
self.uniffiClonePointer(),
6350+
FfiConverterString.lower(eventType),FfiConverterString.lower(content)
6351+
)
6352+
},
6353+
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_void,
6354+
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_void,
6355+
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_void,
6356+
liftFunc: { $0 },
6357+
errorHandler: FfiConverterTypeClientError.lift
6358+
)
6359+
}
6360+
62576361
open func setIsFavourite(isFavourite: Bool, tagOrder: Double?)async throws {
62586362
return
62596363
try await uniffiRustCallAsync(
@@ -17617,6 +17721,8 @@ public enum ClientBuildError {
1761717721

1761817722
case Sdk(message: String)
1761917723

17724+
case EventCache(message: String)
17725+
1762017726
case Generic(message: String)
1762117727

1762217728
}
@@ -17660,7 +17766,11 @@ public struct FfiConverterTypeClientBuildError: FfiConverterRustBuffer {
1766017766
message: try FfiConverterString.read(from: &buf)
1766117767
)
1766217768

17663-
case 8: return .Generic(
17769+
case 8: return .EventCache(
17770+
message: try FfiConverterString.read(from: &buf)
17771+
)
17772+
17773+
case 9: return .Generic(
1766417774
message: try FfiConverterString.read(from: &buf)
1766517775
)
1766617776

@@ -17689,8 +17799,10 @@ public struct FfiConverterTypeClientBuildError: FfiConverterRustBuffer {
1768917799
writeInt(&buf, Int32(6))
1769017800
case .Sdk(_ /* message is ignored*/):
1769117801
writeInt(&buf, Int32(7))
17692-
case .Generic(_ /* message is ignored*/):
17802+
case .EventCache(_ /* message is ignored*/):
1769317803
writeInt(&buf, Int32(8))
17804+
case .Generic(_ /* message is ignored*/):
17805+
writeInt(&buf, Int32(9))
1769417806

1769517807

1769617808
}
@@ -17905,6 +18017,65 @@ extension CrossSigningResetAuthType: Equatable, Hashable {}
1790518017

1790618018

1790718019

18020+
// Note that we don't yet support `indirect` for enums.
18021+
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
18022+
/**
18023+
* Changes how date dividers get inserted, either in between each day or in
18024+
* between each month
18025+
*/
18026+
18027+
public enum DateDividerMode {
18028+
18029+
case daily
18030+
case monthly
18031+
}
18032+
18033+
18034+
public struct FfiConverterTypeDateDividerMode: FfiConverterRustBuffer {
18035+
typealias SwiftType = DateDividerMode
18036+
18037+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> DateDividerMode {
18038+
let variant: Int32 = try readInt(&buf)
18039+
switch variant {
18040+
18041+
case 1: return .daily
18042+
18043+
case 2: return .monthly
18044+
18045+
default: throw UniffiInternalError.unexpectedEnumCase
18046+
}
18047+
}
18048+
18049+
public static func write(_ value: DateDividerMode, into buf: inout [UInt8]) {
18050+
switch value {
18051+
18052+
18053+
case .daily:
18054+
writeInt(&buf, Int32(1))
18055+
18056+
18057+
case .monthly:
18058+
writeInt(&buf, Int32(2))
18059+
18060+
}
18061+
}
18062+
}
18063+
18064+
18065+
public func FfiConverterTypeDateDividerMode_lift(_ buf: RustBuffer) throws -> DateDividerMode {
18066+
return try FfiConverterTypeDateDividerMode.lift(buf)
18067+
}
18068+
18069+
public func FfiConverterTypeDateDividerMode_lower(_ value: DateDividerMode) -> RustBuffer {
18070+
return FfiConverterTypeDateDividerMode.lower(value)
18071+
}
18072+
18073+
18074+
18075+
extension DateDividerMode: Equatable, Hashable {}
18076+
18077+
18078+
1790818079
// Note that we don't yet support `indirect` for enums.
1790918080
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
1791018081

@@ -24241,9 +24412,10 @@ extension VerificationState: Equatable, Hashable {}
2424124412
public enum VirtualTimelineItem {
2424224413

2424324414
/**
24244-
* A divider between messages of two days.
24415+
* A divider between messages of different day or month depending on
24416+
* timeline settings.
2424524417
*/
24246-
case dayDivider(
24418+
case dateDivider(
2424724419
/**
2424824420
* A timestamp in milliseconds since Unix Epoch on that day in local
2424924421
* time.
@@ -24263,7 +24435,7 @@ public struct FfiConverterTypeVirtualTimelineItem: FfiConverterRustBuffer {
2426324435
let variant: Int32 = try readInt(&buf)
2426424436
switch variant {
2426524437

24266-
case 1: return .dayDivider(ts: try FfiConverterUInt64.read(from: &buf)
24438+
case 1: return .dateDivider(ts: try FfiConverterUInt64.read(from: &buf)
2426724439
)
2426824440

2426924441
case 2: return .readMarker
@@ -24276,7 +24448,7 @@ public struct FfiConverterTypeVirtualTimelineItem: FfiConverterRustBuffer {
2427624448
switch value {
2427724449

2427824450

24279-
case let .dayDivider(ts):
24451+
case let .dateDivider(ts):
2428024452
writeInt(&buf, Int32(1))
2428124453
FfiConverterUInt64.write(ts, into: &buf)
2428224454

@@ -29412,6 +29584,9 @@ private var initializationResult: InitializationResult = {
2941229584
if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_sliding_sync_version_builder() != 39381) {
2941329585
return InitializationResult.apiChecksumMismatch
2941429586
}
29587+
if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_use_event_cache_persistent_storage() != 58836) {
29588+
return InitializationResult.apiChecksumMismatch
29589+
}
2941529590
if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_user_agent() != 13719) {
2941629591
return InitializationResult.apiChecksumMismatch
2941729592
}
@@ -29643,6 +29818,9 @@ private var initializationResult: InitializationResult = {
2964329818
if (uniffi_matrix_sdk_ffi_checksum_method_room_clear_composer_draft() != 39667) {
2964429819
return InitializationResult.apiChecksumMismatch
2964529820
}
29821+
if (uniffi_matrix_sdk_ffi_checksum_method_room_clear_event_cache_storage() != 13838) {
29822+
return InitializationResult.apiChecksumMismatch
29823+
}
2964629824
if (uniffi_matrix_sdk_ffi_checksum_method_room_discard_room_key() != 18081) {
2964729825
return InitializationResult.apiChecksumMismatch
2964829826
}
@@ -29742,7 +29920,7 @@ private var initializationResult: InitializationResult = {
2974229920
if (uniffi_matrix_sdk_ffi_checksum_method_room_membership() != 26065) {
2974329921
return InitializationResult.apiChecksumMismatch
2974429922
}
29745-
if (uniffi_matrix_sdk_ffi_checksum_method_room_message_filtered_timeline() != 47862) {
29923+
if (uniffi_matrix_sdk_ffi_checksum_method_room_message_filtered_timeline() != 32258) {
2974629924
return InitializationResult.apiChecksumMismatch
2974729925
}
2974829926
if (uniffi_matrix_sdk_ffi_checksum_method_room_own_user_id() != 39510) {
@@ -29778,6 +29956,9 @@ private var initializationResult: InitializationResult = {
2977829956
if (uniffi_matrix_sdk_ffi_checksum_method_room_send_call_notification_if_needed() != 53551) {
2977929957
return InitializationResult.apiChecksumMismatch
2978029958
}
29959+
if (uniffi_matrix_sdk_ffi_checksum_method_room_send_raw() != 20486) {
29960+
return InitializationResult.apiChecksumMismatch
29961+
}
2978129962
if (uniffi_matrix_sdk_ffi_checksum_method_room_set_is_favourite() != 64403) {
2978229963
return InitializationResult.apiChecksumMismatch
2978329964
}

0 commit comments

Comments
 (0)