Skip to content

Commit e1aa005

Browse files
committed
Bump to version v1.0.11 (matrix-rust-sdk/main 0ec90c2)
1 parent 0f9794c commit e1aa005

File tree

2 files changed

+112
-62
lines changed

2 files changed

+112
-62
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 = "dfc3acd0d39e724c4c1c3f9fe9af4007b7cccf0fd9d6b727f032b5d7bf664197"
5-
let version = "v1.0.10"
4+
let checksum = "5701b40009edad65ea0b2d3ec4488dda72a40f6e6d2476363b57433a13593ff9"
5+
let version = "v1.0.11"
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: 110 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -998,14 +998,15 @@ public protocol ClientProtocol : AnyObject {
998998
func displayName() async throws -> String
999999

10001000
/**
1001-
* Enables or disables the sending queue, according to the given parameter.
1001+
* Enables or disables all the room send queues at once.
10021002
*
1003-
* The sending queue automatically disables itself whenever sending an
1004-
* event with it failed (e.g., sending an event via the high-level Timeline
1005-
* object), so it's required to manually re-enable it as soon as
1006-
* connectivity is back on the device.
1003+
* When connectivity is lost on a device, it is recommended to disable the
1004+
* room sending queues.
1005+
*
1006+
* This can be controlled for individual rooms, using
1007+
* [`Room::enable_send_queue`].
10071008
*/
1008-
func enableSendingQueue(enable: Bool)
1009+
func enableAllSendQueues(enable: Bool)
10091010

10101011
func encryption() -> Encryption
10111012

@@ -1121,13 +1122,13 @@ public protocol ClientProtocol : AnyObject {
11211122
func subscribeToIgnoredUsers(listener: IgnoredUsersListener) -> TaskHandle
11221123

11231124
/**
1124-
* Subscribe to the global enablement status of the sending queue, at the
1125+
* Subscribe to the global enablement status of the send queue, at the
11251126
* client-wide level.
11261127
*
11271128
* The given listener will be immediately called with the initial value of
11281129
* the enablement status.
11291130
*/
1130-
func subscribeToSendingQueueStatus(listener: SendingQueueStatusListener) -> TaskHandle
1131+
func subscribeToSendQueueStatus(listener: SendQueueRoomErrorListener) -> TaskHandle
11311132

11321133
func syncService() -> SyncServiceBuilder
11331134

@@ -1317,15 +1318,16 @@ open func displayName()async throws -> String {
13171318
}
13181319

13191320
/**
1320-
* Enables or disables the sending queue, according to the given parameter.
1321+
* Enables or disables all the room send queues at once.
1322+
*
1323+
* When connectivity is lost on a device, it is recommended to disable the
1324+
* room sending queues.
13211325
*
1322-
* The sending queue automatically disables itself whenever sending an
1323-
* event with it failed (e.g., sending an event via the high-level Timeline
1324-
* object), so it's required to manually re-enable it as soon as
1325-
* connectivity is back on the device.
1326+
* This can be controlled for individual rooms, using
1327+
* [`Room::enable_send_queue`].
13261328
*/
1327-
open func enableSendingQueue(enable: Bool) {try! rustCall() {
1328-
uniffi_matrix_sdk_ffi_fn_method_client_enable_sending_queue(self.uniffiClonePointer(),
1329+
open func enableAllSendQueues(enable: Bool) {try! rustCall() {
1330+
uniffi_matrix_sdk_ffi_fn_method_client_enable_all_send_queues(self.uniffiClonePointer(),
13291331
FfiConverterBool.lower(enable),$0
13301332
)
13311333
}
@@ -1823,16 +1825,16 @@ open func subscribeToIgnoredUsers(listener: IgnoredUsersListener) -> TaskHandle
18231825
}
18241826

18251827
/**
1826-
* Subscribe to the global enablement status of the sending queue, at the
1828+
* Subscribe to the global enablement status of the send queue, at the
18271829
* client-wide level.
18281830
*
18291831
* The given listener will be immediately called with the initial value of
18301832
* the enablement status.
18311833
*/
1832-
open func subscribeToSendingQueueStatus(listener: SendingQueueStatusListener) -> TaskHandle {
1834+
open func subscribeToSendQueueStatus(listener: SendQueueRoomErrorListener) -> TaskHandle {
18331835
return try! FfiConverterTypeTaskHandle.lift(try! rustCall() {
1834-
uniffi_matrix_sdk_ffi_fn_method_client_subscribe_to_sending_queue_status(self.uniffiClonePointer(),
1835-
FfiConverterCallbackInterfaceSendingQueueStatusListener.lower(listener),$0
1836+
uniffi_matrix_sdk_ffi_fn_method_client_subscribe_to_send_queue_status(self.uniffiClonePointer(),
1837+
FfiConverterCallbackInterfaceSendQueueRoomErrorListener.lower(listener),$0
18361838
)
18371839
})
18381840
}
@@ -4615,7 +4617,12 @@ public protocol RoomProtocol : AnyObject {
46154617
* compute a room name based on the room's nature (DM or not) and number of
46164618
* members.
46174619
*/
4618-
func displayName() throws -> String
4620+
func displayName() -> String?
4621+
4622+
/**
4623+
* Enable or disable the send queue for that particular room.
4624+
*/
4625+
func enableSendQueue(enable: Bool)
46194626

46204627
func getPowerLevels() async throws -> RoomPowerLevels
46214628

@@ -4652,6 +4659,12 @@ public protocol RoomProtocol : AnyObject {
46524659

46534660
func isPublic() -> Bool
46544661

4662+
/**
4663+
* Returns whether the send queue for that particular room is enabled or
4664+
* not.
4665+
*/
4666+
func isSendQueueEnabled() -> Bool
4667+
46554668
func isSpace() -> Bool
46564669

46574670
func isTombstoned() -> Bool
@@ -5117,11 +5130,21 @@ open func discardRoomKey()async throws {
51175130
* compute a room name based on the room's nature (DM or not) and number of
51185131
* members.
51195132
*/
5120-
open func displayName()throws -> String {
5121-
return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeClientError.lift) {
5133+
open func displayName() -> String? {
5134+
return try! FfiConverterOptionString.lift(try! rustCall() {
51225135
uniffi_matrix_sdk_ffi_fn_method_room_display_name(self.uniffiClonePointer(),$0
51235136
)
51245137
})
5138+
}
5139+
5140+
/**
5141+
* Enable or disable the send queue for that particular room.
5142+
*/
5143+
open func enableSendQueue(enable: Bool) {try! rustCall() {
5144+
uniffi_matrix_sdk_ffi_fn_method_room_enable_send_queue(self.uniffiClonePointer(),
5145+
FfiConverterBool.lower(enable),$0
5146+
)
5147+
}
51255148
}
51265149

51275150
open func getPowerLevels()async throws -> RoomPowerLevels {
@@ -5248,6 +5271,17 @@ open func isPublic() -> Bool {
52485271
uniffi_matrix_sdk_ffi_fn_method_room_is_public(self.uniffiClonePointer(),$0
52495272
)
52505273
})
5274+
}
5275+
5276+
/**
5277+
* Returns whether the send queue for that particular room is enabled or
5278+
* not.
5279+
*/
5280+
open func isSendQueueEnabled() -> Bool {
5281+
return try! FfiConverterBool.lift(try! rustCall() {
5282+
uniffi_matrix_sdk_ffi_fn_method_room_is_send_queue_enabled(self.uniffiClonePointer(),$0
5283+
)
5284+
})
52515285
}
52525286

52535287
open func isSpace() -> Bool {
@@ -7853,7 +7887,7 @@ public protocol SyncServiceBuilderProtocol : AnyObject {
78537887

78547888
func withCrossProcessLock(appIdentifier: String?) -> SyncServiceBuilder
78557889

7856-
func withUtdHook(delegate: UnableToDecryptDelegate) -> SyncServiceBuilder
7890+
func withUtdHook(delegate: UnableToDecryptDelegate) async -> SyncServiceBuilder
78577891

78587892
}
78597893

@@ -7923,12 +7957,22 @@ open func withCrossProcessLock(appIdentifier: String?) -> SyncServiceBuilder {
79237957
})
79247958
}
79257959

7926-
open func withUtdHook(delegate: UnableToDecryptDelegate) -> SyncServiceBuilder {
7927-
return try! FfiConverterTypeSyncServiceBuilder.lift(try! rustCall() {
7928-
uniffi_matrix_sdk_ffi_fn_method_syncservicebuilder_with_utd_hook(self.uniffiClonePointer(),
7929-
FfiConverterCallbackInterfaceUnableToDecryptDelegate.lower(delegate),$0
7930-
)
7931-
})
7960+
open func withUtdHook(delegate: UnableToDecryptDelegate)async -> SyncServiceBuilder {
7961+
return
7962+
try! await uniffiRustCallAsync(
7963+
rustFutureFunc: {
7964+
uniffi_matrix_sdk_ffi_fn_method_syncservicebuilder_with_utd_hook(
7965+
self.uniffiClonePointer(),
7966+
FfiConverterCallbackInterfaceUnableToDecryptDelegate.lower(delegate)
7967+
)
7968+
},
7969+
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_pointer,
7970+
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_pointer,
7971+
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_pointer,
7972+
liftFunc: FfiConverterTypeSyncServiceBuilder.lift,
7973+
errorHandler: nil
7974+
7975+
)
79327976
}
79337977

79347978

@@ -8189,7 +8233,7 @@ public protocol TimelineProtocol : AnyObject {
81898233
func retryDecryption(sessionIds: [String])
81908234

81918235
/**
8192-
* Queues an event in the room's sending queue so it's processed for
8236+
* Queues an event in the room's send queue so it's processed for
81938237
* sending later.
81948238
*
81958239
* Returns an abort handle that allows to abort sending, if it hasn't
@@ -8551,7 +8595,7 @@ open func retryDecryption(sessionIds: [String]) {try! rustCall() {
85518595
}
85528596

85538597
/**
8554-
* Queues an event in the room's sending queue so it's processed for
8598+
* Queues an event in the room's send queue so it's processed for
85558599
* sending later.
85568600
*
85578601
* Returns an abort handle that allows to abort sending, if it hasn't
@@ -22078,41 +22122,41 @@ extension FfiConverterCallbackInterfaceRoomListServiceSyncIndicatorListener : Ff
2207822122

2207922123

2208022124
/**
22081-
* A listener to the global (client-wide) status of the sending queue.
22125+
* A listener to the global (client-wide) error reporter of the send queue.
2208222126
*/
22083-
public protocol SendingQueueStatusListener : AnyObject {
22127+
public protocol SendQueueRoomErrorListener : AnyObject {
2208422128

2208522129
/**
22086-
* Called every time the sending queue has received a new status.
22087-
*
22088-
* This can be set automatically (in case of sending failure), or manually
22089-
* via an API call.
22130+
* Called every time the send queue has ran into an error for a given room,
22131+
* which will disable the send queue for that particular room.
2209022132
*/
22091-
func onUpdate(newValue: Bool)
22133+
func onError(roomId: String, error: ClientError)
2209222134

2209322135
}
2209422136

2209522137

2209622138

2209722139
// Put the implementation in a struct so we don't pollute the top-level namespace
22098-
fileprivate struct UniffiCallbackInterfaceSendingQueueStatusListener {
22140+
fileprivate struct UniffiCallbackInterfaceSendQueueRoomErrorListener {
2209922141

2210022142
// Create the VTable using a series of closures.
2210122143
// Swift automatically converts these into C callback functions.
22102-
static var vtable: UniffiVTableCallbackInterfaceSendingQueueStatusListener = UniffiVTableCallbackInterfaceSendingQueueStatusListener(
22103-
onUpdate: { (
22144+
static var vtable: UniffiVTableCallbackInterfaceSendQueueRoomErrorListener = UniffiVTableCallbackInterfaceSendQueueRoomErrorListener(
22145+
onError: { (
2210422146
uniffiHandle: UInt64,
22105-
newValue: Int8,
22147+
roomId: RustBuffer,
22148+
error: RustBuffer,
2210622149
uniffiOutReturn: UnsafeMutableRawPointer,
2210722150
uniffiCallStatus: UnsafeMutablePointer<RustCallStatus>
2210822151
) in
2210922152
let makeCall = {
2211022153
() throws -> () in
22111-
guard let uniffiObj = try? FfiConverterCallbackInterfaceSendingQueueStatusListener.handleMap.get(handle: uniffiHandle) else {
22154+
guard let uniffiObj = try? FfiConverterCallbackInterfaceSendQueueRoomErrorListener.handleMap.get(handle: uniffiHandle) else {
2211222155
throw UniffiInternalError.unexpectedStaleHandle
2211322156
}
22114-
return uniffiObj.onUpdate(
22115-
newValue: try FfiConverterBool.lift(newValue)
22157+
return uniffiObj.onError(
22158+
roomId: try FfiConverterString.lift(roomId),
22159+
error: try FfiConverterTypeClientError.lift(error)
2211622160
)
2211722161
}
2211822162

@@ -22125,25 +22169,25 @@ fileprivate struct UniffiCallbackInterfaceSendingQueueStatusListener {
2212522169
)
2212622170
},
2212722171
uniffiFree: { (uniffiHandle: UInt64) -> () in
22128-
let result = try? FfiConverterCallbackInterfaceSendingQueueStatusListener.handleMap.remove(handle: uniffiHandle)
22172+
let result = try? FfiConverterCallbackInterfaceSendQueueRoomErrorListener.handleMap.remove(handle: uniffiHandle)
2212922173
if result == nil {
22130-
print("Uniffi callback interface SendingQueueStatusListener: handle missing in uniffiFree")
22174+
print("Uniffi callback interface SendQueueRoomErrorListener: handle missing in uniffiFree")
2213122175
}
2213222176
}
2213322177
)
2213422178
}
2213522179

22136-
private func uniffiCallbackInitSendingQueueStatusListener() {
22137-
uniffi_matrix_sdk_ffi_fn_init_callback_vtable_sendingqueuestatuslistener(&UniffiCallbackInterfaceSendingQueueStatusListener.vtable)
22180+
private func uniffiCallbackInitSendQueueRoomErrorListener() {
22181+
uniffi_matrix_sdk_ffi_fn_init_callback_vtable_sendqueueroomerrorlistener(&UniffiCallbackInterfaceSendQueueRoomErrorListener.vtable)
2213822182
}
2213922183

2214022184
// FfiConverter protocol for callback interfaces
22141-
fileprivate struct FfiConverterCallbackInterfaceSendingQueueStatusListener {
22142-
fileprivate static var handleMap = UniffiHandleMap<SendingQueueStatusListener>()
22185+
fileprivate struct FfiConverterCallbackInterfaceSendQueueRoomErrorListener {
22186+
fileprivate static var handleMap = UniffiHandleMap<SendQueueRoomErrorListener>()
2214322187
}
2214422188

22145-
extension FfiConverterCallbackInterfaceSendingQueueStatusListener : FfiConverter {
22146-
typealias SwiftType = SendingQueueStatusListener
22189+
extension FfiConverterCallbackInterfaceSendQueueRoomErrorListener : FfiConverter {
22190+
typealias SwiftType = SendQueueRoomErrorListener
2214722191
typealias FfiType = UInt64
2214822192

2214922193
public static func lift(_ handle: UInt64) throws -> SwiftType {
@@ -24989,7 +25033,7 @@ private var initializationResult: InitializationResult {
2498925033
if (uniffi_matrix_sdk_ffi_checksum_method_client_display_name() != 56259) {
2499025034
return InitializationResult.apiChecksumMismatch
2499125035
}
24992-
if (uniffi_matrix_sdk_ffi_checksum_method_client_enable_sending_queue() != 21698) {
25036+
if (uniffi_matrix_sdk_ffi_checksum_method_client_enable_all_send_queues() != 24140) {
2499325037
return InitializationResult.apiChecksumMismatch
2499425038
}
2499525039
if (uniffi_matrix_sdk_ffi_checksum_method_client_encryption() != 9657) {
@@ -25085,7 +25129,7 @@ private var initializationResult: InitializationResult {
2508525129
if (uniffi_matrix_sdk_ffi_checksum_method_client_subscribe_to_ignored_users() != 23285) {
2508625130
return InitializationResult.apiChecksumMismatch
2508725131
}
25088-
if (uniffi_matrix_sdk_ffi_checksum_method_client_subscribe_to_sending_queue_status() != 43691) {
25132+
if (uniffi_matrix_sdk_ffi_checksum_method_client_subscribe_to_send_queue_status() != 57403) {
2508925133
return InitializationResult.apiChecksumMismatch
2509025134
}
2509125135
if (uniffi_matrix_sdk_ffi_checksum_method_client_sync_service() != 52812) {
@@ -25418,7 +25462,10 @@ private var initializationResult: InitializationResult {
2541825462
if (uniffi_matrix_sdk_ffi_checksum_method_room_discard_room_key() != 18081) {
2541925463
return InitializationResult.apiChecksumMismatch
2542025464
}
25421-
if (uniffi_matrix_sdk_ffi_checksum_method_room_display_name() != 30224) {
25465+
if (uniffi_matrix_sdk_ffi_checksum_method_room_display_name() != 64194) {
25466+
return InitializationResult.apiChecksumMismatch
25467+
}
25468+
if (uniffi_matrix_sdk_ffi_checksum_method_room_enable_send_queue() != 23914) {
2542225469
return InitializationResult.apiChecksumMismatch
2542325470
}
2542425471
if (uniffi_matrix_sdk_ffi_checksum_method_room_get_power_levels() != 54094) {
@@ -25451,6 +25498,9 @@ private var initializationResult: InitializationResult {
2545125498
if (uniffi_matrix_sdk_ffi_checksum_method_room_is_public() != 7336) {
2545225499
return InitializationResult.apiChecksumMismatch
2545325500
}
25501+
if (uniffi_matrix_sdk_ffi_checksum_method_room_is_send_queue_enabled() != 36591) {
25502+
return InitializationResult.apiChecksumMismatch
25503+
}
2545425504
if (uniffi_matrix_sdk_ffi_checksum_method_room_is_space() != 16919) {
2545525505
return InitializationResult.apiChecksumMismatch
2545625506
}
@@ -25721,7 +25771,7 @@ private var initializationResult: InitializationResult {
2572125771
if (uniffi_matrix_sdk_ffi_checksum_method_syncservicebuilder_with_cross_process_lock() != 31599) {
2572225772
return InitializationResult.apiChecksumMismatch
2572325773
}
25724-
if (uniffi_matrix_sdk_ffi_checksum_method_syncservicebuilder_with_utd_hook() != 61858) {
25774+
if (uniffi_matrix_sdk_ffi_checksum_method_syncservicebuilder_with_utd_hook() != 9029) {
2572525775
return InitializationResult.apiChecksumMismatch
2572625776
}
2572725777
if (uniffi_matrix_sdk_ffi_checksum_method_taskhandle_cancel() != 9124) {
@@ -25775,7 +25825,7 @@ private var initializationResult: InitializationResult {
2577525825
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_retry_decryption() != 21112) {
2577625826
return InitializationResult.apiChecksumMismatch
2577725827
}
25778-
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_send() != 35299) {
25828+
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_send() != 62420) {
2577925829
return InitializationResult.apiChecksumMismatch
2578025830
}
2578125831
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_send_audio() != 47157) {
@@ -25964,7 +26014,7 @@ private var initializationResult: InitializationResult {
2596426014
if (uniffi_matrix_sdk_ffi_checksum_method_roomlistservicesyncindicatorlistener_on_update() != 36937) {
2596526015
return InitializationResult.apiChecksumMismatch
2596626016
}
25967-
if (uniffi_matrix_sdk_ffi_checksum_method_sendingqueuestatuslistener_on_update() != 65345) {
26017+
if (uniffi_matrix_sdk_ffi_checksum_method_sendqueueroomerrorlistener_on_error() != 38224) {
2596826018
return InitializationResult.apiChecksumMismatch
2596926019
}
2597026020
if (uniffi_matrix_sdk_ffi_checksum_method_sessionverificationcontrollerdelegate_did_accept_verification_request() != 22759) {
@@ -26021,7 +26071,7 @@ private var initializationResult: InitializationResult {
2602126071
uniffiCallbackInitRoomListLoadingStateListener()
2602226072
uniffiCallbackInitRoomListServiceStateListener()
2602326073
uniffiCallbackInitRoomListServiceSyncIndicatorListener()
26024-
uniffiCallbackInitSendingQueueStatusListener()
26074+
uniffiCallbackInitSendQueueRoomErrorListener()
2602526075
uniffiCallbackInitSessionVerificationControllerDelegate()
2602626076
uniffiCallbackInitSyncServiceStateObserver()
2602726077
uniffiCallbackInitTimelineListener()

0 commit comments

Comments
 (0)