Skip to content

Commit f42b210

Browse files
committed
Bump to version 25.02.28 (matrix-rust-sdk/main a67f9d5bbfda97a097897b6a47aa9553b4ca55a3)
1 parent 38b03bc commit f42b210

File tree

4 files changed

+143
-97
lines changed

4 files changed

+143
-97
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 = "b84e7bcefd239ca35983dbfffc5f07c76593c1aae254d23ffdbe427d5198eb80"
5-
let version = "25.02.25-2"
4+
let checksum = "96ab741ee37d6d16033d95bbe4c09f2cca9d1dc3854076b84ff886aa687d574d"
5+
let version = "25.02.28"
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.swift

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,27 @@ fileprivate struct FfiConverterInt64: FfiConverterPrimitive {
395395
}
396396
}
397397

398+
fileprivate struct FfiConverterBool : FfiConverter {
399+
typealias FfiType = Int8
400+
typealias SwiftType = Bool
401+
402+
public static func lift(_ value: Int8) throws -> Bool {
403+
return value != 0
404+
}
405+
406+
public static func lower(_ value: Bool) -> Int8 {
407+
return value ? 1 : 0
408+
}
409+
410+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Bool {
411+
return try lift(readInt(&buf))
412+
}
413+
414+
public static func write(_ value: Bool, into buf: inout [UInt8]) {
415+
writeInt(&buf, lower(value))
416+
}
417+
}
418+
398419
fileprivate struct FfiConverterString: FfiConverter {
399420
typealias SwiftType = String
400421
typealias FfiType = RustBuffer
@@ -1130,6 +1151,77 @@ extension RoomMemberRole: Equatable, Hashable {}
11301151

11311152

11321153

1154+
// Note that we don't yet support `indirect` for enums.
1155+
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
1156+
/**
1157+
* Status for the back-pagination on a room event cache.
1158+
*/
1159+
1160+
public enum RoomPaginationStatus {
1161+
1162+
/**
1163+
* No back-pagination is happening right now.
1164+
*/
1165+
case idle(
1166+
/**
1167+
* Have we hit the start of the timeline, i.e. back-paginating wouldn't
1168+
* have any effect?
1169+
*/hitTimelineStart: Bool
1170+
)
1171+
/**
1172+
* Back-pagination is already running in the background.
1173+
*/
1174+
case paginating
1175+
}
1176+
1177+
1178+
public struct FfiConverterTypeRoomPaginationStatus: FfiConverterRustBuffer {
1179+
typealias SwiftType = RoomPaginationStatus
1180+
1181+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> RoomPaginationStatus {
1182+
let variant: Int32 = try readInt(&buf)
1183+
switch variant {
1184+
1185+
case 1: return .idle(hitTimelineStart: try FfiConverterBool.read(from: &buf)
1186+
)
1187+
1188+
case 2: return .paginating
1189+
1190+
default: throw UniffiInternalError.unexpectedEnumCase
1191+
}
1192+
}
1193+
1194+
public static func write(_ value: RoomPaginationStatus, into buf: inout [UInt8]) {
1195+
switch value {
1196+
1197+
1198+
case let .idle(hitTimelineStart):
1199+
writeInt(&buf, Int32(1))
1200+
FfiConverterBool.write(hitTimelineStart, into: &buf)
1201+
1202+
1203+
case .paginating:
1204+
writeInt(&buf, Int32(2))
1205+
1206+
}
1207+
}
1208+
}
1209+
1210+
1211+
public func FfiConverterTypeRoomPaginationStatus_lift(_ buf: RustBuffer) throws -> RoomPaginationStatus {
1212+
return try FfiConverterTypeRoomPaginationStatus.lift(buf)
1213+
}
1214+
1215+
public func FfiConverterTypeRoomPaginationStatus_lower(_ value: RoomPaginationStatus) -> RustBuffer {
1216+
return FfiConverterTypeRoomPaginationStatus.lower(value)
1217+
}
1218+
1219+
1220+
1221+
extension RoomPaginationStatus: Equatable, Hashable {}
1222+
1223+
1224+
11331225
fileprivate struct FfiConverterOptionInt64: FfiConverterRustBuffer {
11341226
typealias SwiftType = Int64?
11351227

Sources/MatrixRustSDK/matrix_sdk_ffi.swift

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5345,6 +5345,20 @@ public protocol RoomProtocol : AnyObject {
53455345
*/
53465346
func reportContent(eventId: String, score: Int32?, reason: String?) async throws
53475347

5348+
/**
5349+
* Reports a room as inappropriate to the server.
5350+
* The caller is not required to be joined to the room to report it.
5351+
*
5352+
* # Arguments
5353+
*
5354+
* * `reason` - The reason the room is being reported.
5355+
*
5356+
* # Errors
5357+
*
5358+
* Returns an error if the room is not found or on rate limit
5359+
*/
5360+
func reportRoom(reason: String?) async throws
5361+
53485362
func resetPowerLevels() async throws -> RoomPowerLevels
53495363

53505364
/**
@@ -6556,6 +6570,35 @@ open func reportContent(eventId: String, score: Int32?, reason: String?)async th
65566570
)
65576571
}
65586572

6573+
/**
6574+
* Reports a room as inappropriate to the server.
6575+
* The caller is not required to be joined to the room to report it.
6576+
*
6577+
* # Arguments
6578+
*
6579+
* * `reason` - The reason the room is being reported.
6580+
*
6581+
* # Errors
6582+
*
6583+
* Returns an error if the room is not found or on rate limit
6584+
*/
6585+
open func reportRoom(reason: String?)async throws {
6586+
return
6587+
try await uniffiRustCallAsync(
6588+
rustFutureFunc: {
6589+
uniffi_matrix_sdk_ffi_fn_method_room_report_room(
6590+
self.uniffiClonePointer(),
6591+
FfiConverterOptionString.lower(reason)
6592+
)
6593+
},
6594+
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_void,
6595+
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_void,
6596+
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_void,
6597+
liftFunc: { $0 },
6598+
errorHandler: FfiConverterTypeClientError.lift
6599+
)
6600+
}
6601+
65596602
open func resetPowerLevels()async throws -> RoomPowerLevels {
65606603
return
65616604
try await uniffiRustCallAsync(
@@ -27802,7 +27845,7 @@ extension FfiConverterCallbackInterfaceNotificationSettingsDelegate : FfiConvert
2780227845

2780327846
public protocol PaginationStatusListener : AnyObject {
2780427847

27805-
func onUpdate(status: LiveBackPaginationStatus)
27848+
func onUpdate(status: RoomPaginationStatus)
2780627849

2780727850
}
2780827851

@@ -27826,7 +27869,7 @@ fileprivate struct UniffiCallbackInterfacePaginationStatusListener {
2782627869
throw UniffiInternalError.unexpectedStaleHandle
2782727870
}
2782827871
return uniffiObj.onUpdate(
27829-
status: try FfiConverterTypeLiveBackPaginationStatus_lift(status)
27872+
status: try FfiConverterTypeRoomPaginationStatus_lift(status)
2783027873
)
2783127874
}
2783227875

@@ -32644,6 +32687,9 @@ private var initializationResult: InitializationResult = {
3264432687
if (uniffi_matrix_sdk_ffi_checksum_method_room_report_content() != 16529) {
3264532688
return InitializationResult.apiChecksumMismatch
3264632689
}
32690+
if (uniffi_matrix_sdk_ffi_checksum_method_room_report_room() != 8059) {
32691+
return InitializationResult.apiChecksumMismatch
32692+
}
3264732693
if (uniffi_matrix_sdk_ffi_checksum_method_room_reset_power_levels() != 63622) {
3264832694
return InitializationResult.apiChecksumMismatch
3264932695
}
@@ -33181,7 +33227,7 @@ private var initializationResult: InitializationResult = {
3318133227
if (uniffi_matrix_sdk_ffi_checksum_method_notificationsettingsdelegate_settings_did_change() != 51708) {
3318233228
return InitializationResult.apiChecksumMismatch
3318333229
}
33184-
if (uniffi_matrix_sdk_ffi_checksum_method_paginationstatuslistener_on_update() != 29884) {
33230+
if (uniffi_matrix_sdk_ffi_checksum_method_paginationstatuslistener_on_update() != 65318) {
3318533231
return InitializationResult.apiChecksumMismatch
3318633232
}
3318733233
if (uniffi_matrix_sdk_ffi_checksum_method_progresswatcher_transmission_progress() != 41133) {

Sources/MatrixRustSDK/matrix_sdk_ui.swift

Lines changed: 0 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -382,27 +382,6 @@ fileprivate class UniffiHandleMap<T> {
382382
// Public interface members begin here.
383383

384384

385-
fileprivate struct FfiConverterBool : FfiConverter {
386-
typealias FfiType = Int8
387-
typealias SwiftType = Bool
388-
389-
public static func lift(_ value: Int8) throws -> Bool {
390-
return value != 0
391-
}
392-
393-
public static func lower(_ value: Bool) -> Int8 {
394-
return value ? 1 : 0
395-
}
396-
397-
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Bool {
398-
return try lift(readInt(&buf))
399-
}
400-
401-
public static func write(_ value: Bool, into buf: inout [UInt8]) {
402-
writeInt(&buf, lower(value))
403-
}
404-
}
405-
406385
fileprivate struct FfiConverterString: FfiConverter {
407386
typealias SwiftType = String
408387
typealias FfiType = RustBuffer
@@ -515,77 +494,6 @@ extension EventItemOrigin: Equatable, Hashable {}
515494

516495

517496

518-
// Note that we don't yet support `indirect` for enums.
519-
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
520-
/**
521-
* Status for the back-pagination on a live timeline.
522-
*/
523-
524-
public enum LiveBackPaginationStatus {
525-
526-
/**
527-
* No back-pagination is happening right now.
528-
*/
529-
case idle(
530-
/**
531-
* Have we hit the start of the timeline, i.e. back-paginating wouldn't
532-
* have any effect?
533-
*/hitStartOfTimeline: Bool
534-
)
535-
/**
536-
* Back-pagination is already running in the background.
537-
*/
538-
case paginating
539-
}
540-
541-
542-
public struct FfiConverterTypeLiveBackPaginationStatus: FfiConverterRustBuffer {
543-
typealias SwiftType = LiveBackPaginationStatus
544-
545-
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> LiveBackPaginationStatus {
546-
let variant: Int32 = try readInt(&buf)
547-
switch variant {
548-
549-
case 1: return .idle(hitStartOfTimeline: try FfiConverterBool.read(from: &buf)
550-
)
551-
552-
case 2: return .paginating
553-
554-
default: throw UniffiInternalError.unexpectedEnumCase
555-
}
556-
}
557-
558-
public static func write(_ value: LiveBackPaginationStatus, into buf: inout [UInt8]) {
559-
switch value {
560-
561-
562-
case let .idle(hitStartOfTimeline):
563-
writeInt(&buf, Int32(1))
564-
FfiConverterBool.write(hitStartOfTimeline, into: &buf)
565-
566-
567-
case .paginating:
568-
writeInt(&buf, Int32(2))
569-
570-
}
571-
}
572-
}
573-
574-
575-
public func FfiConverterTypeLiveBackPaginationStatus_lift(_ buf: RustBuffer) throws -> LiveBackPaginationStatus {
576-
return try FfiConverterTypeLiveBackPaginationStatus.lift(buf)
577-
}
578-
579-
public func FfiConverterTypeLiveBackPaginationStatus_lower(_ value: LiveBackPaginationStatus) -> RustBuffer {
580-
return FfiConverterTypeLiveBackPaginationStatus.lower(value)
581-
}
582-
583-
584-
585-
extension LiveBackPaginationStatus: Equatable, Hashable {}
586-
587-
588-
589497
// Note that we don't yet support `indirect` for enums.
590498
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
591499
/**

0 commit comments

Comments
 (0)