Skip to content

Commit 9ca4d9e

Browse files
committed
Bump to version 25.07.04 (matrix-rust-sdk/main b44a1e46c4c843c25a3e5577d000f7045e996f64)
1 parent ab5a18f commit 9ca4d9e

File tree

2 files changed

+191
-47
lines changed

2 files changed

+191
-47
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 = "044575db2aebf2246c95584c650fbbb12c07781d192bf5b4d6887a5962db8ddc"
5-
let version = "25.07.03"
4+
let checksum = "e4fbf0286dc3622de67ebd78f64b5d8be67bd61c153ba6327a04109b9495c564"
5+
let version = "25.07.04"
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: 189 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2867,6 +2867,8 @@ public protocol ClientBuilderProtocol : AnyObject {
28672867
*/
28682868
func systemIsMemoryConstrained() -> ClientBuilder
28692869

2870+
func threadsEnabled(enabled: Bool) -> ClientBuilder
2871+
28702872
func userAgent(userAgent: String) -> ClientBuilder
28712873

28722874
func username(username: String) -> ClientBuilder
@@ -3250,6 +3252,14 @@ open func systemIsMemoryConstrained() -> ClientBuilder {
32503252
})
32513253
}
32523254

3255+
open func threadsEnabled(enabled: Bool) -> ClientBuilder {
3256+
return try! FfiConverterTypeClientBuilder.lift(try! rustCall() {
3257+
uniffi_matrix_sdk_ffi_fn_method_clientbuilder_threads_enabled(self.uniffiClonePointer(),
3258+
FfiConverterBool.lower(enabled),$0
3259+
)
3260+
})
3261+
}
3262+
32533263
open func userAgent(userAgent: String) -> ClientBuilder {
32543264
return try! FfiConverterTypeClientBuilder.lift(try! rustCall() {
32553265
uniffi_matrix_sdk_ffi_fn_method_clientbuilder_user_agent(self.uniffiClonePointer(),
@@ -4892,10 +4902,16 @@ public func FfiConverterTypeMediaSource_lower(_ value: MediaSource) -> UnsafeMut
48924902
public protocol NotificationClientProtocol : AnyObject {
48934903

48944904
/**
4895-
* See also documentation of
4896-
* `MatrixNotificationClient::get_notification`.
4905+
* Fetches the content of a notification.
4906+
*
4907+
* This will first try to get the notification using a short-lived sliding
4908+
* sync, and if the sliding-sync can't find the event, then it'll use a
4909+
* `/context` query to find the event with associated member information.
4910+
*
4911+
* An error result means that we couldn't resolve the notification; in that
4912+
* case, a dummy notification may be displayed instead.
48974913
*/
4898-
func getNotification(roomId: String, eventId: String) async throws -> NotificationItem?
4914+
func getNotification(roomId: String, eventId: String) async throws -> NotificationStatus
48994915

49004916
/**
49014917
* Get several notification items in a single batch.
@@ -4905,7 +4921,7 @@ public protocol NotificationClientProtocol : AnyObject {
49054921
* [`NotificationItem`] or no entry for it if it failed to fetch a
49064922
* notification for the provided [`EventId`].
49074923
*/
4908-
func getNotifications(requests: [NotificationItemsRequest]) async throws -> [String: NotificationItem]
4924+
func getNotifications(requests: [NotificationItemsRequest]) async throws -> [String: BatchNotificationResult]
49094925

49104926
/**
49114927
* Fetches a room by its ID using the in-memory state store backed client.
@@ -4959,10 +4975,16 @@ open class NotificationClient:
49594975

49604976

49614977
/**
4962-
* See also documentation of
4963-
* `MatrixNotificationClient::get_notification`.
4978+
* Fetches the content of a notification.
4979+
*
4980+
* This will first try to get the notification using a short-lived sliding
4981+
* sync, and if the sliding-sync can't find the event, then it'll use a
4982+
* `/context` query to find the event with associated member information.
4983+
*
4984+
* An error result means that we couldn't resolve the notification; in that
4985+
* case, a dummy notification may be displayed instead.
49644986
*/
4965-
open func getNotification(roomId: String, eventId: String)async throws -> NotificationItem? {
4987+
open func getNotification(roomId: String, eventId: String)async throws -> NotificationStatus {
49664988
return
49674989
try await uniffiRustCallAsync(
49684990
rustFutureFunc: {
@@ -4974,7 +4996,7 @@ open func getNotification(roomId: String, eventId: String)async throws -> Notif
49744996
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer,
49754997
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer,
49764998
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_rust_buffer,
4977-
liftFunc: FfiConverterOptionTypeNotificationItem.lift,
4999+
liftFunc: FfiConverterTypeNotificationStatus.lift,
49785000
errorHandler: FfiConverterTypeClientError.lift
49795001
)
49805002
}
@@ -4987,7 +5009,7 @@ open func getNotification(roomId: String, eventId: String)async throws -> Notif
49875009
* [`NotificationItem`] or no entry for it if it failed to fetch a
49885010
* notification for the provided [`EventId`].
49895011
*/
4990-
open func getNotifications(requests: [NotificationItemsRequest])async throws -> [String: NotificationItem] {
5012+
open func getNotifications(requests: [NotificationItemsRequest])async throws -> [String: BatchNotificationResult] {
49915013
return
49925014
try await uniffiRustCallAsync(
49935015
rustFutureFunc: {
@@ -4999,7 +5021,7 @@ open func getNotifications(requests: [NotificationItemsRequest])async throws ->
49995021
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer,
50005022
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer,
50015023
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_rust_buffer,
5002-
liftFunc: FfiConverterDictionaryStringTypeNotificationItem.lift,
5024+
liftFunc: FfiConverterDictionaryStringTypeBatchNotificationResult.lift,
50035025
errorHandler: FfiConverterTypeClientError.lift
50045026
)
50055027
}
@@ -21652,6 +21674,73 @@ extension BackupUploadState: Equatable, Hashable {}
2165221674

2165321675

2165421676

21677+
// Note that we don't yet support `indirect` for enums.
21678+
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
21679+
21680+
public enum BatchNotificationResult {
21681+
21682+
/**
21683+
* We have more detailed information about the notification.
21684+
*/
21685+
case ok(status: NotificationStatus
21686+
)
21687+
/**
21688+
* An error occurred while trying to fetch the notification.
21689+
*/
21690+
case error(
21691+
/**
21692+
* The error message observed while handling a specific notification.
21693+
*/message: String
21694+
)
21695+
}
21696+
21697+
21698+
public struct FfiConverterTypeBatchNotificationResult: FfiConverterRustBuffer {
21699+
typealias SwiftType = BatchNotificationResult
21700+
21701+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> BatchNotificationResult {
21702+
let variant: Int32 = try readInt(&buf)
21703+
switch variant {
21704+
21705+
case 1: return .ok(status: try FfiConverterTypeNotificationStatus.read(from: &buf)
21706+
)
21707+
21708+
case 2: return .error(message: try FfiConverterString.read(from: &buf)
21709+
)
21710+
21711+
default: throw UniffiInternalError.unexpectedEnumCase
21712+
}
21713+
}
21714+
21715+
public static func write(_ value: BatchNotificationResult, into buf: inout [UInt8]) {
21716+
switch value {
21717+
21718+
21719+
case let .ok(status):
21720+
writeInt(&buf, Int32(1))
21721+
FfiConverterTypeNotificationStatus.write(status, into: &buf)
21722+
21723+
21724+
case let .error(message):
21725+
writeInt(&buf, Int32(2))
21726+
FfiConverterString.write(message, into: &buf)
21727+
21728+
}
21729+
}
21730+
}
21731+
21732+
21733+
public func FfiConverterTypeBatchNotificationResult_lift(_ buf: RustBuffer) throws -> BatchNotificationResult {
21734+
return try FfiConverterTypeBatchNotificationResult.lift(buf)
21735+
}
21736+
21737+
public func FfiConverterTypeBatchNotificationResult_lower(_ value: BatchNotificationResult) -> RustBuffer {
21738+
return FfiConverterTypeBatchNotificationResult.lower(value)
21739+
}
21740+
21741+
21742+
21743+
2165521744

2165621745
public enum ClientBuildError {
2165721746

@@ -25678,6 +25767,79 @@ extension NotificationSettingsError: Foundation.LocalizedError {
2567825767
}
2567925768
}
2568025769

25770+
// Note that we don't yet support `indirect` for enums.
25771+
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
25772+
25773+
public enum NotificationStatus {
25774+
25775+
/**
25776+
* The event has been found and was not filtered out.
25777+
*/
25778+
case event(item: NotificationItem
25779+
)
25780+
/**
25781+
* The event couldn't be found in the network queries used to find it.
25782+
*/
25783+
case eventNotFound
25784+
/**
25785+
* The event has been filtered out, either because of the user's push
25786+
* rules, or because the user which triggered it is ignored by the
25787+
* current user.
25788+
*/
25789+
case eventFilteredOut
25790+
}
25791+
25792+
25793+
public struct FfiConverterTypeNotificationStatus: FfiConverterRustBuffer {
25794+
typealias SwiftType = NotificationStatus
25795+
25796+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> NotificationStatus {
25797+
let variant: Int32 = try readInt(&buf)
25798+
switch variant {
25799+
25800+
case 1: return .event(item: try FfiConverterTypeNotificationItem.read(from: &buf)
25801+
)
25802+
25803+
case 2: return .eventNotFound
25804+
25805+
case 3: return .eventFilteredOut
25806+
25807+
default: throw UniffiInternalError.unexpectedEnumCase
25808+
}
25809+
}
25810+
25811+
public static func write(_ value: NotificationStatus, into buf: inout [UInt8]) {
25812+
switch value {
25813+
25814+
25815+
case let .event(item):
25816+
writeInt(&buf, Int32(1))
25817+
FfiConverterTypeNotificationItem.write(item, into: &buf)
25818+
25819+
25820+
case .eventNotFound:
25821+
writeInt(&buf, Int32(2))
25822+
25823+
25824+
case .eventFilteredOut:
25825+
writeInt(&buf, Int32(3))
25826+
25827+
}
25828+
}
25829+
}
25830+
25831+
25832+
public func FfiConverterTypeNotificationStatus_lift(_ buf: RustBuffer) throws -> NotificationStatus {
25833+
return try FfiConverterTypeNotificationStatus.lift(buf)
25834+
}
25835+
25836+
public func FfiConverterTypeNotificationStatus_lower(_ value: NotificationStatus) -> RustBuffer {
25837+
return FfiConverterTypeNotificationStatus.lower(value)
25838+
}
25839+
25840+
25841+
25842+
2568125843
// Note that we don't yet support `indirect` for enums.
2568225844
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
2568325845

@@ -34401,27 +34563,6 @@ fileprivate struct FfiConverterOptionTypeMentions: FfiConverterRustBuffer {
3440134563
}
3440234564
}
3440334565

34404-
fileprivate struct FfiConverterOptionTypeNotificationItem: FfiConverterRustBuffer {
34405-
typealias SwiftType = NotificationItem?
34406-
34407-
public static func write(_ value: SwiftType, into buf: inout [UInt8]) {
34408-
guard let value = value else {
34409-
writeInt(&buf, Int8(0))
34410-
return
34411-
}
34412-
writeInt(&buf, Int8(1))
34413-
FfiConverterTypeNotificationItem.write(value, into: &buf)
34414-
}
34415-
34416-
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType {
34417-
switch try readInt(&buf) as Int8 {
34418-
case 0: return nil
34419-
case 1: return try FfiConverterTypeNotificationItem.read(from: &buf)
34420-
default: throw UniffiInternalError.unexpectedOptionalTag
34421-
}
34422-
}
34423-
}
34424-
3442534566
fileprivate struct FfiConverterOptionTypeNotificationPowerLevels: FfiConverterRustBuffer {
3442634567
typealias SwiftType = NotificationPowerLevels?
3442734568

@@ -36231,46 +36372,46 @@ fileprivate struct FfiConverterDictionaryStringTypeIgnoredUser: FfiConverterRust
3623136372
}
3623236373
}
3623336374

36234-
fileprivate struct FfiConverterDictionaryStringTypeNotificationItem: FfiConverterRustBuffer {
36235-
public static func write(_ value: [String: NotificationItem], into buf: inout [UInt8]) {
36375+
fileprivate struct FfiConverterDictionaryStringTypeReceipt: FfiConverterRustBuffer {
36376+
public static func write(_ value: [String: Receipt], into buf: inout [UInt8]) {
3623636377
let len = Int32(value.count)
3623736378
writeInt(&buf, len)
3623836379
for (key, value) in value {
3623936380
FfiConverterString.write(key, into: &buf)
36240-
FfiConverterTypeNotificationItem.write(value, into: &buf)
36381+
FfiConverterTypeReceipt.write(value, into: &buf)
3624136382
}
3624236383
}
3624336384

36244-
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [String: NotificationItem] {
36385+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [String: Receipt] {
3624536386
let len: Int32 = try readInt(&buf)
36246-
var dict = [String: NotificationItem]()
36387+
var dict = [String: Receipt]()
3624736388
dict.reserveCapacity(Int(len))
3624836389
for _ in 0..<len {
3624936390
let key = try FfiConverterString.read(from: &buf)
36250-
let value = try FfiConverterTypeNotificationItem.read(from: &buf)
36391+
let value = try FfiConverterTypeReceipt.read(from: &buf)
3625136392
dict[key] = value
3625236393
}
3625336394
return dict
3625436395
}
3625536396
}
3625636397

36257-
fileprivate struct FfiConverterDictionaryStringTypeReceipt: FfiConverterRustBuffer {
36258-
public static func write(_ value: [String: Receipt], into buf: inout [UInt8]) {
36398+
fileprivate struct FfiConverterDictionaryStringTypeBatchNotificationResult: FfiConverterRustBuffer {
36399+
public static func write(_ value: [String: BatchNotificationResult], into buf: inout [UInt8]) {
3625936400
let len = Int32(value.count)
3626036401
writeInt(&buf, len)
3626136402
for (key, value) in value {
3626236403
FfiConverterString.write(key, into: &buf)
36263-
FfiConverterTypeReceipt.write(value, into: &buf)
36404+
FfiConverterTypeBatchNotificationResult.write(value, into: &buf)
3626436405
}
3626536406
}
3626636407

36267-
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [String: Receipt] {
36408+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [String: BatchNotificationResult] {
3626836409
let len: Int32 = try readInt(&buf)
36269-
var dict = [String: Receipt]()
36410+
var dict = [String: BatchNotificationResult]()
3627036411
dict.reserveCapacity(Int(len))
3627136412
for _ in 0..<len {
3627236413
let key = try FfiConverterString.read(from: &buf)
36273-
let value = try FfiConverterTypeReceipt.read(from: &buf)
36414+
let value = try FfiConverterTypeBatchNotificationResult.read(from: &buf)
3627436415
dict[key] = value
3627536416
}
3627636417
return dict
@@ -37118,6 +37259,9 @@ private var initializationResult: InitializationResult = {
3711837259
if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_system_is_memory_constrained() != 6898) {
3711937260
return InitializationResult.apiChecksumMismatch
3712037261
}
37262+
if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_threads_enabled() != 33768) {
37263+
return InitializationResult.apiChecksumMismatch
37264+
}
3712137265
if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_user_agent() != 13719) {
3712237266
return InitializationResult.apiChecksumMismatch
3712337267
}
@@ -37250,10 +37394,10 @@ private var initializationResult: InitializationResult = {
3725037394
if (uniffi_matrix_sdk_ffi_checksum_method_mediasource_url() != 62692) {
3725137395
return InitializationResult.apiChecksumMismatch
3725237396
}
37253-
if (uniffi_matrix_sdk_ffi_checksum_method_notificationclient_get_notification() != 2524) {
37397+
if (uniffi_matrix_sdk_ffi_checksum_method_notificationclient_get_notification() != 52873) {
3725437398
return InitializationResult.apiChecksumMismatch
3725537399
}
37256-
if (uniffi_matrix_sdk_ffi_checksum_method_notificationclient_get_notifications() != 30600) {
37400+
if (uniffi_matrix_sdk_ffi_checksum_method_notificationclient_get_notifications() != 32112) {
3725737401
return InitializationResult.apiChecksumMismatch
3725837402
}
3725937403
if (uniffi_matrix_sdk_ffi_checksum_method_notificationclient_get_room() != 26581) {

0 commit comments

Comments
 (0)