Skip to content

Commit f647c08

Browse files
committed
Bump to v0.0.2-november23 (matrix-rust-sdk/poljar/recovery 9387160a7ed7e5b447d8d2de0ed8d2500cedf468)
1 parent 29870fa commit f647c08

File tree

2 files changed

+57
-24
lines changed

2 files changed

+57
-24
lines changed

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
import PackageDescription
55

6-
let checksum = "558ff9267e9b325a37eb79df96784d44c835908040f43551ee700fb1fe66a59e"
7-
let version = "v0.0.1-november23"
6+
let checksum = "06bab33becab69141ee3a6ec07ff25eb579502f47d7804cd3bb6d79a075a7a4d"
7+
let version = "v0.0.2-november23"
88
let url = "https://github.com/matrix-org/matrix-rust-components-swift/releases/download/\(version)/MatrixSDKFFI.xcframework.zip"
99

1010
let package = Package(

Sources/MatrixRustSDK/matrix_sdk_ffi.swift

Lines changed: 55 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ public protocol ClientProtocol : AnyObject {
639639
func encryption() -> Encryption
640640
func getDmRoom(userId: String) throws -> Room?
641641
func getMediaContent(mediaSource: MediaSource) throws -> Data
642-
func getMediaFile(mediaSource: MediaSource, body: String?, mimeType: String, tempDir: String?) throws -> MediaFileHandle
642+
func getMediaFile(mediaSource: MediaSource, body: String?, mimeType: String, useCache: Bool, tempDir: String?) throws -> MediaFileHandle
643643
func getMediaThumbnail(mediaSource: MediaSource, width: UInt64, height: UInt64) throws -> Data
644644
func getNotificationSettings() -> NotificationSettings
645645
func getProfile(userId: String) throws -> UserProfile
@@ -791,14 +791,15 @@ public class Client: ClientProtocol {
791791
)
792792
}
793793

794-
public func getMediaFile(mediaSource: MediaSource, body: String?, mimeType: String, tempDir: String?) throws -> MediaFileHandle {
794+
public func getMediaFile(mediaSource: MediaSource, body: String?, mimeType: String, useCache: Bool, tempDir: String?) throws -> MediaFileHandle {
795795
return try FfiConverterTypeMediaFileHandle.lift(
796796
try
797797
rustCallWithError(FfiConverterTypeClientError.lift) {
798798
uniffi_matrix_sdk_ffi_fn_method_client_get_media_file(self.pointer,
799799
FfiConverterTypeMediaSource.lower(mediaSource),
800800
FfiConverterOptionString.lower(body),
801801
FfiConverterString.lower(mimeType),
802+
FfiConverterBool.lower(useCache),
802803
FfiConverterOptionString.lower(tempDir),$0
803804
)
804805
}
@@ -1345,6 +1346,7 @@ public func FfiConverterTypeClientBuilder_lower(_ value: ClientBuilder) -> Unsaf
13451346

13461347

13471348
public protocol EncryptionProtocol : AnyObject {
1349+
func backupExistsOnServer() async throws -> Bool
13481350
func backupState() -> BackupState
13491351
func backupStateListener(listener: BackupStateListener) -> TaskHandle
13501352
func disableRecovery() async throws
@@ -1379,6 +1381,23 @@ public class Encryption: EncryptionProtocol {
13791381

13801382

13811383

1384+
public func backupExistsOnServer() async throws -> Bool {
1385+
return try await uniffiRustCallAsync(
1386+
rustFutureFunc: {
1387+
uniffi_matrix_sdk_ffi_fn_method_encryption_backup_exists_on_server(
1388+
self.pointer
1389+
)
1390+
},
1391+
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_i8,
1392+
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_i8,
1393+
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_i8,
1394+
liftFunc: FfiConverterBool.lift,
1395+
errorHandler: FfiConverterTypeClientError.lift
1396+
)
1397+
}
1398+
1399+
1400+
13821401
public func backupState() -> BackupState {
13831402
return try! FfiConverterTypeBackupState.lift(
13841403
try!
@@ -1970,7 +1989,8 @@ public func FfiConverterTypeHomeserverLoginDetails_lower(_ value: HomeserverLogi
19701989

19711990

19721991
public protocol MediaFileHandleProtocol : AnyObject {
1973-
func path() -> String
1992+
func path() throws -> String
1993+
func persist(path: String) throws -> Bool
19741994

19751995
}
19761996

@@ -1993,13 +2013,23 @@ public class MediaFileHandle: MediaFileHandleProtocol {
19932013

19942014

19952015

1996-
public func path() -> String {
1997-
return try! FfiConverterString.lift(
1998-
try!
1999-
rustCall() {
2000-
2016+
public func path() throws -> String {
2017+
return try FfiConverterString.lift(
2018+
try
2019+
rustCallWithError(FfiConverterTypeClientError.lift) {
20012020
uniffi_matrix_sdk_ffi_fn_method_mediafilehandle_path(self.pointer, $0
20022021
)
2022+
}
2023+
)
2024+
}
2025+
2026+
public func persist(path: String) throws -> Bool {
2027+
return try FfiConverterBool.lift(
2028+
try
2029+
rustCallWithError(FfiConverterTypeClientError.lift) {
2030+
uniffi_matrix_sdk_ffi_fn_method_mediafilehandle_persist(self.pointer,
2031+
FfiConverterString.lower(path),$0
2032+
)
20032033
}
20042034
)
20052035
}
@@ -7468,14 +7498,16 @@ public struct NotificationItem {
74687498
public var senderInfo: NotificationSenderInfo
74697499
public var roomInfo: NotificationRoomInfo
74707500
public var isNoisy: Bool?
7501+
public var hasMention: Bool?
74717502

74727503
// Default memberwise initializers are never public by default, so we
74737504
// declare one manually.
7474-
public init(event: NotificationEvent, senderInfo: NotificationSenderInfo, roomInfo: NotificationRoomInfo, isNoisy: Bool?) {
7505+
public init(event: NotificationEvent, senderInfo: NotificationSenderInfo, roomInfo: NotificationRoomInfo, isNoisy: Bool?, hasMention: Bool?) {
74757506
self.event = event
74767507
self.senderInfo = senderInfo
74777508
self.roomInfo = roomInfo
74787509
self.isNoisy = isNoisy
7510+
self.hasMention = hasMention
74797511
}
74807512
}
74817513

@@ -7488,7 +7520,8 @@ public struct FfiConverterTypeNotificationItem: FfiConverterRustBuffer {
74887520
event: FfiConverterTypeNotificationEvent.read(from: &buf),
74897521
senderInfo: FfiConverterTypeNotificationSenderInfo.read(from: &buf),
74907522
roomInfo: FfiConverterTypeNotificationRoomInfo.read(from: &buf),
7491-
isNoisy: FfiConverterOptionBool.read(from: &buf)
7523+
isNoisy: FfiConverterOptionBool.read(from: &buf),
7524+
hasMention: FfiConverterOptionBool.read(from: &buf)
74927525
)
74937526
}
74947527

@@ -7497,6 +7530,7 @@ public struct FfiConverterTypeNotificationItem: FfiConverterRustBuffer {
74977530
FfiConverterTypeNotificationSenderInfo.write(value.senderInfo, into: &buf)
74987531
FfiConverterTypeNotificationRoomInfo.write(value.roomInfo, into: &buf)
74997532
FfiConverterOptionBool.write(value.isNoisy, into: &buf)
7533+
FfiConverterOptionBool.write(value.hasMention, into: &buf)
75007534
}
75017535
}
75027536

@@ -10036,7 +10070,6 @@ public enum BackupState {
1003610070
case enabled
1003710071
case downloading
1003810072
case disabling
10039-
case disabled
1004010073
}
1004110074

1004210075
public struct FfiConverterTypeBackupState: FfiConverterRustBuffer {
@@ -10060,8 +10093,6 @@ public struct FfiConverterTypeBackupState: FfiConverterRustBuffer {
1006010093

1006110094
case 7: return .disabling
1006210095

10063-
case 8: return .disabled
10064-
1006510096
default: throw UniffiInternalError.unexpectedEnumCase
1006610097
}
1006710098
}
@@ -10097,10 +10128,6 @@ public struct FfiConverterTypeBackupState: FfiConverterRustBuffer {
1009710128
case .disabling:
1009810129
writeInt(&buf, Int32(7))
1009910130

10100-
10101-
case .disabled:
10102-
writeInt(&buf, Int32(8))
10103-
1010410131
}
1010510132
}
1010610133
}
@@ -11920,7 +11947,7 @@ extension OtherState: Equatable, Hashable {}
1192011947
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
1192111948
public enum PaginationOptions {
1192211949

11923-
case singleRequest(eventLimit: UInt16, waitForToken: Bool)
11950+
case simpleRequest(eventLimit: UInt16, waitForToken: Bool)
1192411951
case untilNumItems(eventLimit: UInt16, items: UInt16, waitForToken: Bool)
1192511952
}
1192611953

@@ -11931,7 +11958,7 @@ public struct FfiConverterTypePaginationOptions: FfiConverterRustBuffer {
1193111958
let variant: Int32 = try readInt(&buf)
1193211959
switch variant {
1193311960

11934-
case 1: return .singleRequest(
11961+
case 1: return .simpleRequest(
1193511962
eventLimit: try FfiConverterUInt16.read(from: &buf),
1193611963
waitForToken: try FfiConverterBool.read(from: &buf)
1193711964
)
@@ -11950,7 +11977,7 @@ public struct FfiConverterTypePaginationOptions: FfiConverterRustBuffer {
1195011977
switch value {
1195111978

1195211979

11953-
case let .singleRequest(eventLimit,waitForToken):
11980+
case let .simpleRequest(eventLimit,waitForToken):
1195411981
writeInt(&buf, Int32(1))
1195511982
FfiConverterUInt16.write(eventLimit, into: &buf)
1195611983
FfiConverterBool.write(waitForToken, into: &buf)
@@ -17903,7 +17930,7 @@ private var initializationResult: InitializationResult {
1790317930
if (uniffi_matrix_sdk_ffi_checksum_method_client_get_media_content() != 25167) {
1790417931
return InitializationResult.apiChecksumMismatch
1790517932
}
17906-
if (uniffi_matrix_sdk_ffi_checksum_method_client_get_media_file() != 23010) {
17933+
if (uniffi_matrix_sdk_ffi_checksum_method_client_get_media_file() != 60005) {
1790717934
return InitializationResult.apiChecksumMismatch
1790817935
}
1790917936
if (uniffi_matrix_sdk_ffi_checksum_method_client_get_media_thumbnail() != 51889) {
@@ -18017,6 +18044,9 @@ private var initializationResult: InitializationResult {
1801718044
if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_username() != 64379) {
1801818045
return InitializationResult.apiChecksumMismatch
1801918046
}
18047+
if (uniffi_matrix_sdk_ffi_checksum_method_encryption_backup_exists_on_server() != 17130) {
18048+
return InitializationResult.apiChecksumMismatch
18049+
}
1802018050
if (uniffi_matrix_sdk_ffi_checksum_method_encryption_backup_state() != 13611) {
1802118051
return InitializationResult.apiChecksumMismatch
1802218052
}
@@ -18110,7 +18140,10 @@ private var initializationResult: InitializationResult {
1811018140
if (uniffi_matrix_sdk_ffi_checksum_method_homeserverlogindetails_url() != 40398) {
1811118141
return InitializationResult.apiChecksumMismatch
1811218142
}
18113-
if (uniffi_matrix_sdk_ffi_checksum_method_mediafilehandle_path() != 57070) {
18143+
if (uniffi_matrix_sdk_ffi_checksum_method_mediafilehandle_path() != 2500) {
18144+
return InitializationResult.apiChecksumMismatch
18145+
}
18146+
if (uniffi_matrix_sdk_ffi_checksum_method_mediafilehandle_persist() != 4346) {
1811418147
return InitializationResult.apiChecksumMismatch
1811518148
}
1811618149
if (uniffi_matrix_sdk_ffi_checksum_method_message_body() != 2560) {

0 commit comments

Comments
 (0)