@@ -639,7 +639,7 @@ public protocol ClientProtocol : AnyObject {
639
639
func encryption() -> Encryption
640
640
func getDmRoom(userId: String) throws -> Room?
641
641
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
643
643
func getMediaThumbnail(mediaSource: MediaSource, width: UInt64, height: UInt64) throws -> Data
644
644
func getNotificationSettings() -> NotificationSettings
645
645
func getProfile(userId: String) throws -> UserProfile
@@ -791,14 +791,15 @@ public class Client: ClientProtocol {
791
791
)
792
792
}
793
793
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 {
795
795
return try FfiConverterTypeMediaFileHandle.lift(
796
796
try
797
797
rustCallWithError(FfiConverterTypeClientError.lift) {
798
798
uniffi_matrix_sdk_ffi_fn_method_client_get_media_file(self.pointer,
799
799
FfiConverterTypeMediaSource.lower(mediaSource),
800
800
FfiConverterOptionString.lower(body),
801
801
FfiConverterString.lower(mimeType),
802
+ FfiConverterBool.lower(useCache),
802
803
FfiConverterOptionString.lower(tempDir),$0
803
804
)
804
805
}
@@ -1345,6 +1346,7 @@ public func FfiConverterTypeClientBuilder_lower(_ value: ClientBuilder) -> Unsaf
1345
1346
1346
1347
1347
1348
public protocol EncryptionProtocol : AnyObject {
1349
+ func backupExistsOnServer() async throws -> Bool
1348
1350
func backupState() -> BackupState
1349
1351
func backupStateListener(listener: BackupStateListener) -> TaskHandle
1350
1352
func disableRecovery() async throws
@@ -1379,6 +1381,23 @@ public class Encryption: EncryptionProtocol {
1379
1381
1380
1382
1381
1383
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
+
1382
1401
public func backupState() -> BackupState {
1383
1402
return try! FfiConverterTypeBackupState.lift(
1384
1403
try!
@@ -1970,7 +1989,8 @@ public func FfiConverterTypeHomeserverLoginDetails_lower(_ value: HomeserverLogi
1970
1989
1971
1990
1972
1991
public protocol MediaFileHandleProtocol : AnyObject {
1973
- func path() -> String
1992
+ func path() throws -> String
1993
+ func persist(path: String) throws -> Bool
1974
1994
1975
1995
}
1976
1996
@@ -1993,13 +2013,23 @@ public class MediaFileHandle: MediaFileHandleProtocol {
1993
2013
1994
2014
1995
2015
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) {
2001
2020
uniffi_matrix_sdk_ffi_fn_method_mediafilehandle_path(self.pointer, $0
2002
2021
)
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
+ )
2003
2033
}
2004
2034
)
2005
2035
}
@@ -7468,14 +7498,16 @@ public struct NotificationItem {
7468
7498
public var senderInfo: NotificationSenderInfo
7469
7499
public var roomInfo: NotificationRoomInfo
7470
7500
public var isNoisy: Bool?
7501
+ public var hasMention: Bool?
7471
7502
7472
7503
// Default memberwise initializers are never public by default, so we
7473
7504
// 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? ) {
7475
7506
self.event = event
7476
7507
self.senderInfo = senderInfo
7477
7508
self.roomInfo = roomInfo
7478
7509
self.isNoisy = isNoisy
7510
+ self.hasMention = hasMention
7479
7511
}
7480
7512
}
7481
7513
@@ -7488,7 +7520,8 @@ public struct FfiConverterTypeNotificationItem: FfiConverterRustBuffer {
7488
7520
event: FfiConverterTypeNotificationEvent.read(from: &buf),
7489
7521
senderInfo: FfiConverterTypeNotificationSenderInfo.read(from: &buf),
7490
7522
roomInfo: FfiConverterTypeNotificationRoomInfo.read(from: &buf),
7491
- isNoisy: FfiConverterOptionBool.read(from: &buf)
7523
+ isNoisy: FfiConverterOptionBool.read(from: &buf),
7524
+ hasMention: FfiConverterOptionBool.read(from: &buf)
7492
7525
)
7493
7526
}
7494
7527
@@ -7497,6 +7530,7 @@ public struct FfiConverterTypeNotificationItem: FfiConverterRustBuffer {
7497
7530
FfiConverterTypeNotificationSenderInfo.write(value.senderInfo, into: &buf)
7498
7531
FfiConverterTypeNotificationRoomInfo.write(value.roomInfo, into: &buf)
7499
7532
FfiConverterOptionBool.write(value.isNoisy, into: &buf)
7533
+ FfiConverterOptionBool.write(value.hasMention, into: &buf)
7500
7534
}
7501
7535
}
7502
7536
@@ -10036,7 +10070,6 @@ public enum BackupState {
10036
10070
case enabled
10037
10071
case downloading
10038
10072
case disabling
10039
- case disabled
10040
10073
}
10041
10074
10042
10075
public struct FfiConverterTypeBackupState: FfiConverterRustBuffer {
@@ -10060,8 +10093,6 @@ public struct FfiConverterTypeBackupState: FfiConverterRustBuffer {
10060
10093
10061
10094
case 7: return .disabling
10062
10095
10063
- case 8: return .disabled
10064
-
10065
10096
default: throw UniffiInternalError.unexpectedEnumCase
10066
10097
}
10067
10098
}
@@ -10097,10 +10128,6 @@ public struct FfiConverterTypeBackupState: FfiConverterRustBuffer {
10097
10128
case .disabling:
10098
10129
writeInt(&buf, Int32(7))
10099
10130
10100
-
10101
- case .disabled:
10102
- writeInt(&buf, Int32(8))
10103
-
10104
10131
}
10105
10132
}
10106
10133
}
@@ -11920,7 +11947,7 @@ extension OtherState: Equatable, Hashable {}
11920
11947
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
11921
11948
public enum PaginationOptions {
11922
11949
11923
- case singleRequest (eventLimit: UInt16, waitForToken: Bool)
11950
+ case simpleRequest (eventLimit: UInt16, waitForToken: Bool)
11924
11951
case untilNumItems(eventLimit: UInt16, items: UInt16, waitForToken: Bool)
11925
11952
}
11926
11953
@@ -11931,7 +11958,7 @@ public struct FfiConverterTypePaginationOptions: FfiConverterRustBuffer {
11931
11958
let variant: Int32 = try readInt(&buf)
11932
11959
switch variant {
11933
11960
11934
- case 1: return .singleRequest (
11961
+ case 1: return .simpleRequest (
11935
11962
eventLimit: try FfiConverterUInt16.read(from: &buf),
11936
11963
waitForToken: try FfiConverterBool.read(from: &buf)
11937
11964
)
@@ -11950,7 +11977,7 @@ public struct FfiConverterTypePaginationOptions: FfiConverterRustBuffer {
11950
11977
switch value {
11951
11978
11952
11979
11953
- case let .singleRequest (eventLimit,waitForToken):
11980
+ case let .simpleRequest (eventLimit,waitForToken):
11954
11981
writeInt(&buf, Int32(1))
11955
11982
FfiConverterUInt16.write(eventLimit, into: &buf)
11956
11983
FfiConverterBool.write(waitForToken, into: &buf)
@@ -17903,7 +17930,7 @@ private var initializationResult: InitializationResult {
17903
17930
if (uniffi_matrix_sdk_ffi_checksum_method_client_get_media_content() != 25167) {
17904
17931
return InitializationResult.apiChecksumMismatch
17905
17932
}
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 ) {
17907
17934
return InitializationResult.apiChecksumMismatch
17908
17935
}
17909
17936
if (uniffi_matrix_sdk_ffi_checksum_method_client_get_media_thumbnail() != 51889) {
@@ -18017,6 +18044,9 @@ private var initializationResult: InitializationResult {
18017
18044
if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_username() != 64379) {
18018
18045
return InitializationResult.apiChecksumMismatch
18019
18046
}
18047
+ if (uniffi_matrix_sdk_ffi_checksum_method_encryption_backup_exists_on_server() != 17130) {
18048
+ return InitializationResult.apiChecksumMismatch
18049
+ }
18020
18050
if (uniffi_matrix_sdk_ffi_checksum_method_encryption_backup_state() != 13611) {
18021
18051
return InitializationResult.apiChecksumMismatch
18022
18052
}
@@ -18110,7 +18140,10 @@ private var initializationResult: InitializationResult {
18110
18140
if (uniffi_matrix_sdk_ffi_checksum_method_homeserverlogindetails_url() != 40398) {
18111
18141
return InitializationResult.apiChecksumMismatch
18112
18142
}
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) {
18114
18147
return InitializationResult.apiChecksumMismatch
18115
18148
}
18116
18149
if (uniffi_matrix_sdk_ffi_checksum_method_message_body() != 2560) {
0 commit comments