@@ -998,14 +998,15 @@ public protocol ClientProtocol : AnyObject {
998
998
func displayName() async throws -> String
999
999
1000
1000
/**
1001
- * Enables or disables the sending queue, according to the given parameter .
1001
+ * Enables or disables all the room send queues at once .
1002
1002
*
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`].
1007
1008
*/
1008
- func enableSendingQueue (enable: Bool)
1009
+ func enableAllSendQueues (enable: Bool)
1009
1010
1010
1011
func encryption() -> Encryption
1011
1012
@@ -1121,13 +1122,13 @@ public protocol ClientProtocol : AnyObject {
1121
1122
func subscribeToIgnoredUsers(listener: IgnoredUsersListener) -> TaskHandle
1122
1123
1123
1124
/**
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
1125
1126
* client-wide level.
1126
1127
*
1127
1128
* The given listener will be immediately called with the initial value of
1128
1129
* the enablement status.
1129
1130
*/
1130
- func subscribeToSendingQueueStatus (listener: SendingQueueStatusListener ) -> TaskHandle
1131
+ func subscribeToSendQueueStatus (listener: SendQueueRoomErrorListener ) -> TaskHandle
1131
1132
1132
1133
func syncService() -> SyncServiceBuilder
1133
1134
@@ -1317,15 +1318,16 @@ open func displayName()async throws -> String {
1317
1318
}
1318
1319
1319
1320
/**
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.
1321
1325
*
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`].
1326
1328
*/
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(),
1329
1331
FfiConverterBool.lower(enable),$0
1330
1332
)
1331
1333
}
@@ -1823,16 +1825,16 @@ open func subscribeToIgnoredUsers(listener: IgnoredUsersListener) -> TaskHandle
1823
1825
}
1824
1826
1825
1827
/**
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
1827
1829
* client-wide level.
1828
1830
*
1829
1831
* The given listener will be immediately called with the initial value of
1830
1832
* the enablement status.
1831
1833
*/
1832
- open func subscribeToSendingQueueStatus (listener: SendingQueueStatusListener ) -> TaskHandle {
1834
+ open func subscribeToSendQueueStatus (listener: SendQueueRoomErrorListener ) -> TaskHandle {
1833
1835
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
1836
1838
)
1837
1839
})
1838
1840
}
@@ -4615,7 +4617,12 @@ public protocol RoomProtocol : AnyObject {
4615
4617
* compute a room name based on the room's nature (DM or not) and number of
4616
4618
* members.
4617
4619
*/
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)
4619
4626
4620
4627
func getPowerLevels() async throws -> RoomPowerLevels
4621
4628
@@ -4652,6 +4659,12 @@ public protocol RoomProtocol : AnyObject {
4652
4659
4653
4660
func isPublic() -> Bool
4654
4661
4662
+ /**
4663
+ * Returns whether the send queue for that particular room is enabled or
4664
+ * not.
4665
+ */
4666
+ func isSendQueueEnabled() -> Bool
4667
+
4655
4668
func isSpace() -> Bool
4656
4669
4657
4670
func isTombstoned() -> Bool
@@ -5117,11 +5130,21 @@ open func discardRoomKey()async throws {
5117
5130
* compute a room name based on the room's nature (DM or not) and number of
5118
5131
* members.
5119
5132
*/
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( ) {
5122
5135
uniffi_matrix_sdk_ffi_fn_method_room_display_name(self.uniffiClonePointer(),$0
5123
5136
)
5124
5137
})
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
+ }
5125
5148
}
5126
5149
5127
5150
open func getPowerLevels()async throws -> RoomPowerLevels {
@@ -5248,6 +5271,17 @@ open func isPublic() -> Bool {
5248
5271
uniffi_matrix_sdk_ffi_fn_method_room_is_public(self.uniffiClonePointer(),$0
5249
5272
)
5250
5273
})
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
+ })
5251
5285
}
5252
5286
5253
5287
open func isSpace() -> Bool {
@@ -7853,7 +7887,7 @@ public protocol SyncServiceBuilderProtocol : AnyObject {
7853
7887
7854
7888
func withCrossProcessLock(appIdentifier: String?) -> SyncServiceBuilder
7855
7889
7856
- func withUtdHook(delegate: UnableToDecryptDelegate) -> SyncServiceBuilder
7890
+ func withUtdHook(delegate: UnableToDecryptDelegate) async -> SyncServiceBuilder
7857
7891
7858
7892
}
7859
7893
@@ -7923,12 +7957,22 @@ open func withCrossProcessLock(appIdentifier: String?) -> SyncServiceBuilder {
7923
7957
})
7924
7958
}
7925
7959
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
+ )
7932
7976
}
7933
7977
7934
7978
@@ -8189,7 +8233,7 @@ public protocol TimelineProtocol : AnyObject {
8189
8233
func retryDecryption(sessionIds: [String])
8190
8234
8191
8235
/**
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
8193
8237
* sending later.
8194
8238
*
8195
8239
* Returns an abort handle that allows to abort sending, if it hasn't
@@ -8551,7 +8595,7 @@ open func retryDecryption(sessionIds: [String]) {try! rustCall() {
8551
8595
}
8552
8596
8553
8597
/**
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
8555
8599
* sending later.
8556
8600
*
8557
8601
* Returns an abort handle that allows to abort sending, if it hasn't
@@ -22078,41 +22122,41 @@ extension FfiConverterCallbackInterfaceRoomListServiceSyncIndicatorListener : Ff
22078
22122
22079
22123
22080
22124
/**
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.
22082
22126
*/
22083
- public protocol SendingQueueStatusListener : AnyObject {
22127
+ public protocol SendQueueRoomErrorListener : AnyObject {
22084
22128
22085
22129
/**
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.
22090
22132
*/
22091
- func onUpdate(newValue: Bool )
22133
+ func onError(roomId: String, error: ClientError )
22092
22134
22093
22135
}
22094
22136
22095
22137
22096
22138
22097
22139
// Put the implementation in a struct so we don't pollute the top-level namespace
22098
- fileprivate struct UniffiCallbackInterfaceSendingQueueStatusListener {
22140
+ fileprivate struct UniffiCallbackInterfaceSendQueueRoomErrorListener {
22099
22141
22100
22142
// Create the VTable using a series of closures.
22101
22143
// Swift automatically converts these into C callback functions.
22102
- static var vtable: UniffiVTableCallbackInterfaceSendingQueueStatusListener = UniffiVTableCallbackInterfaceSendingQueueStatusListener (
22103
- onUpdate : { (
22144
+ static var vtable: UniffiVTableCallbackInterfaceSendQueueRoomErrorListener = UniffiVTableCallbackInterfaceSendQueueRoomErrorListener (
22145
+ onError : { (
22104
22146
uniffiHandle: UInt64,
22105
- newValue: Int8,
22147
+ roomId: RustBuffer,
22148
+ error: RustBuffer,
22106
22149
uniffiOutReturn: UnsafeMutableRawPointer,
22107
22150
uniffiCallStatus: UnsafeMutablePointer<RustCallStatus>
22108
22151
) in
22109
22152
let makeCall = {
22110
22153
() throws -> () in
22111
- guard let uniffiObj = try? FfiConverterCallbackInterfaceSendingQueueStatusListener .handleMap.get(handle: uniffiHandle) else {
22154
+ guard let uniffiObj = try? FfiConverterCallbackInterfaceSendQueueRoomErrorListener .handleMap.get(handle: uniffiHandle) else {
22112
22155
throw UniffiInternalError.unexpectedStaleHandle
22113
22156
}
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)
22116
22160
)
22117
22161
}
22118
22162
@@ -22125,25 +22169,25 @@ fileprivate struct UniffiCallbackInterfaceSendingQueueStatusListener {
22125
22169
)
22126
22170
},
22127
22171
uniffiFree: { (uniffiHandle: UInt64) -> () in
22128
- let result = try? FfiConverterCallbackInterfaceSendingQueueStatusListener .handleMap.remove(handle: uniffiHandle)
22172
+ let result = try? FfiConverterCallbackInterfaceSendQueueRoomErrorListener .handleMap.remove(handle: uniffiHandle)
22129
22173
if result == nil {
22130
- print("Uniffi callback interface SendingQueueStatusListener : handle missing in uniffiFree")
22174
+ print("Uniffi callback interface SendQueueRoomErrorListener : handle missing in uniffiFree")
22131
22175
}
22132
22176
}
22133
22177
)
22134
22178
}
22135
22179
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)
22138
22182
}
22139
22183
22140
22184
// 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 >()
22143
22187
}
22144
22188
22145
- extension FfiConverterCallbackInterfaceSendingQueueStatusListener : FfiConverter {
22146
- typealias SwiftType = SendingQueueStatusListener
22189
+ extension FfiConverterCallbackInterfaceSendQueueRoomErrorListener : FfiConverter {
22190
+ typealias SwiftType = SendQueueRoomErrorListener
22147
22191
typealias FfiType = UInt64
22148
22192
22149
22193
public static func lift(_ handle: UInt64) throws -> SwiftType {
@@ -24989,7 +25033,7 @@ private var initializationResult: InitializationResult {
24989
25033
if (uniffi_matrix_sdk_ffi_checksum_method_client_display_name() != 56259) {
24990
25034
return InitializationResult.apiChecksumMismatch
24991
25035
}
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 ) {
24993
25037
return InitializationResult.apiChecksumMismatch
24994
25038
}
24995
25039
if (uniffi_matrix_sdk_ffi_checksum_method_client_encryption() != 9657) {
@@ -25085,7 +25129,7 @@ private var initializationResult: InitializationResult {
25085
25129
if (uniffi_matrix_sdk_ffi_checksum_method_client_subscribe_to_ignored_users() != 23285) {
25086
25130
return InitializationResult.apiChecksumMismatch
25087
25131
}
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 ) {
25089
25133
return InitializationResult.apiChecksumMismatch
25090
25134
}
25091
25135
if (uniffi_matrix_sdk_ffi_checksum_method_client_sync_service() != 52812) {
@@ -25418,7 +25462,10 @@ private var initializationResult: InitializationResult {
25418
25462
if (uniffi_matrix_sdk_ffi_checksum_method_room_discard_room_key() != 18081) {
25419
25463
return InitializationResult.apiChecksumMismatch
25420
25464
}
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) {
25422
25469
return InitializationResult.apiChecksumMismatch
25423
25470
}
25424
25471
if (uniffi_matrix_sdk_ffi_checksum_method_room_get_power_levels() != 54094) {
@@ -25451,6 +25498,9 @@ private var initializationResult: InitializationResult {
25451
25498
if (uniffi_matrix_sdk_ffi_checksum_method_room_is_public() != 7336) {
25452
25499
return InitializationResult.apiChecksumMismatch
25453
25500
}
25501
+ if (uniffi_matrix_sdk_ffi_checksum_method_room_is_send_queue_enabled() != 36591) {
25502
+ return InitializationResult.apiChecksumMismatch
25503
+ }
25454
25504
if (uniffi_matrix_sdk_ffi_checksum_method_room_is_space() != 16919) {
25455
25505
return InitializationResult.apiChecksumMismatch
25456
25506
}
@@ -25721,7 +25771,7 @@ private var initializationResult: InitializationResult {
25721
25771
if (uniffi_matrix_sdk_ffi_checksum_method_syncservicebuilder_with_cross_process_lock() != 31599) {
25722
25772
return InitializationResult.apiChecksumMismatch
25723
25773
}
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 ) {
25725
25775
return InitializationResult.apiChecksumMismatch
25726
25776
}
25727
25777
if (uniffi_matrix_sdk_ffi_checksum_method_taskhandle_cancel() != 9124) {
@@ -25775,7 +25825,7 @@ private var initializationResult: InitializationResult {
25775
25825
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_retry_decryption() != 21112) {
25776
25826
return InitializationResult.apiChecksumMismatch
25777
25827
}
25778
- if (uniffi_matrix_sdk_ffi_checksum_method_timeline_send() != 35299 ) {
25828
+ if (uniffi_matrix_sdk_ffi_checksum_method_timeline_send() != 62420 ) {
25779
25829
return InitializationResult.apiChecksumMismatch
25780
25830
}
25781
25831
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_send_audio() != 47157) {
@@ -25964,7 +26014,7 @@ private var initializationResult: InitializationResult {
25964
26014
if (uniffi_matrix_sdk_ffi_checksum_method_roomlistservicesyncindicatorlistener_on_update() != 36937) {
25965
26015
return InitializationResult.apiChecksumMismatch
25966
26016
}
25967
- if (uniffi_matrix_sdk_ffi_checksum_method_sendingqueuestatuslistener_on_update () != 65345 ) {
26017
+ if (uniffi_matrix_sdk_ffi_checksum_method_sendqueueroomerrorlistener_on_error () != 38224 ) {
25968
26018
return InitializationResult.apiChecksumMismatch
25969
26019
}
25970
26020
if (uniffi_matrix_sdk_ffi_checksum_method_sessionverificationcontrollerdelegate_did_accept_verification_request() != 22759) {
@@ -26021,7 +26071,7 @@ private var initializationResult: InitializationResult {
26021
26071
uniffiCallbackInitRoomListLoadingStateListener()
26022
26072
uniffiCallbackInitRoomListServiceStateListener()
26023
26073
uniffiCallbackInitRoomListServiceSyncIndicatorListener()
26024
- uniffiCallbackInitSendingQueueStatusListener ()
26074
+ uniffiCallbackInitSendQueueRoomErrorListener ()
26025
26075
uniffiCallbackInitSessionVerificationControllerDelegate()
26026
26076
uniffiCallbackInitSyncServiceStateObserver()
26027
26077
uniffiCallbackInitTimelineListener()
0 commit comments