Skip to content

Commit 753c538

Browse files
committed
Bump to version v1.0.58 (matrix-rust-sdk/main 4f49b23)
1 parent 5f01589 commit 753c538

File tree

2 files changed

+197
-31
lines changed

2 files changed

+197
-31
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 = "e08f2573590c6c87e9ba7ad095eb4a2b7deb4d90f86e062e34b3276b3374312d"
5-
let version = "v1.0.57"
4+
let checksum = "0b761add19d40c6a6aea1ea3d7ee4b583437be3f27046295a4372e37cb22f838"
5+
let version = "v1.0.58"
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: 195 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ public protocol ClientProtocol : AnyObject {
581581
* Aborts an existing OIDC login operation that might have been cancelled,
582582
* failed etc.
583583
*/
584-
func abortOidcLogin(authorizationData: OidcAuthorizationData) async
584+
func abortOidcAuth(authorizationData: OidcAuthorizationData) async
585585

586586
/**
587587
* Get the content of the event of the given type out of the account data
@@ -866,12 +866,12 @@ public protocol ClientProtocol : AnyObject {
866866
func uploadMedia(mimeType: String, data: Data, progressWatcher: ProgressWatcher?) async throws -> String
867867

868868
/**
869-
* Requests the URL needed for login in a web view using OIDC. Once the web
869+
* Requests the URL needed for opening a web view using OIDC. Once the web
870870
* view has succeeded, call `login_with_oidc_callback` with the callback it
871871
* returns. If a failure occurs and a callback isn't available, make sure
872-
* to call `abort_oidc_login` to inform the client of this.
872+
* to call `abort_oidc_auth` to inform the client of this.
873873
*/
874-
func urlForOidcLogin(oidcConfiguration: OidcConfiguration) async throws -> OidcAuthorizationData
874+
func urlForOidc(oidcConfiguration: OidcConfiguration, prompt: OidcPrompt) async throws -> OidcAuthorizationData
875875

876876
func userId() throws -> String
877877

@@ -927,11 +927,11 @@ open class Client:
927927
* Aborts an existing OIDC login operation that might have been cancelled,
928928
* failed etc.
929929
*/
930-
open func abortOidcLogin(authorizationData: OidcAuthorizationData)async {
930+
open func abortOidcAuth(authorizationData: OidcAuthorizationData)async {
931931
return
932932
try! await uniffiRustCallAsync(
933933
rustFutureFunc: {
934-
uniffi_matrix_sdk_ffi_fn_method_client_abort_oidc_login(
934+
uniffi_matrix_sdk_ffi_fn_method_client_abort_oidc_auth(
935935
self.uniffiClonePointer(),
936936
FfiConverterTypeOidcAuthorizationData_lower(authorizationData)
937937
)
@@ -1975,18 +1975,18 @@ open func uploadMedia(mimeType: String, data: Data, progressWatcher: ProgressWat
19751975
}
19761976

19771977
/**
1978-
* Requests the URL needed for login in a web view using OIDC. Once the web
1978+
* Requests the URL needed for opening a web view using OIDC. Once the web
19791979
* view has succeeded, call `login_with_oidc_callback` with the callback it
19801980
* returns. If a failure occurs and a callback isn't available, make sure
1981-
* to call `abort_oidc_login` to inform the client of this.
1981+
* to call `abort_oidc_auth` to inform the client of this.
19821982
*/
1983-
open func urlForOidcLogin(oidcConfiguration: OidcConfiguration)async throws -> OidcAuthorizationData {
1983+
open func urlForOidc(oidcConfiguration: OidcConfiguration, prompt: OidcPrompt)async throws -> OidcAuthorizationData {
19841984
return
19851985
try await uniffiRustCallAsync(
19861986
rustFutureFunc: {
1987-
uniffi_matrix_sdk_ffi_fn_method_client_url_for_oidc_login(
1987+
uniffi_matrix_sdk_ffi_fn_method_client_url_for_oidc(
19881988
self.uniffiClonePointer(),
1989-
FfiConverterTypeOidcConfiguration.lower(oidcConfiguration)
1989+
FfiConverterTypeOidcConfiguration.lower(oidcConfiguration),FfiConverterTypeOidcPrompt.lower(prompt)
19901990
)
19911991
},
19921992
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_pointer,
@@ -9127,19 +9127,17 @@ public protocol TimelineProtocol : AnyObject {
91279127
/**
91289128
* Toggle a reaction on an event.
91299129
*
9130-
* The `unique_id` parameter is a string returned by
9131-
* the `TimelineItem::unique_id()` method. As such, this method works both
9132-
* on local echoes and remote items.
9133-
*
91349130
* Adds or redacts a reaction based on the state of the reaction at the
91359131
* time it is called.
91369132
*
9133+
* This method works both on local echoes and remote items.
9134+
*
91379135
* When redacting a previous reaction, the redaction reason is not set.
91389136
*
91399137
* Ensures that only one reaction is sent at a time to avoid race
91409138
* conditions and spamming the homeserver with requests.
91419139
*/
9142-
func toggleReaction(uniqueId: String, key: String) async throws
9140+
func toggleReaction(itemId: EventOrTransactionId, key: String) async throws
91439141

91449142
/**
91459143
* Adds a new pinned event by sending an updated `m.room.pinned_events`
@@ -9684,25 +9682,23 @@ open func subscribeToBackPaginationStatus(listener: PaginationStatusListener)asy
96849682
/**
96859683
* Toggle a reaction on an event.
96869684
*
9687-
* The `unique_id` parameter is a string returned by
9688-
* the `TimelineItem::unique_id()` method. As such, this method works both
9689-
* on local echoes and remote items.
9690-
*
96919685
* Adds or redacts a reaction based on the state of the reaction at the
96929686
* time it is called.
96939687
*
9688+
* This method works both on local echoes and remote items.
9689+
*
96949690
* When redacting a previous reaction, the redaction reason is not set.
96959691
*
96969692
* Ensures that only one reaction is sent at a time to avoid race
96979693
* conditions and spamming the homeserver with requests.
96989694
*/
9699-
open func toggleReaction(uniqueId: String, key: String)async throws {
9695+
open func toggleReaction(itemId: EventOrTransactionId, key: String)async throws {
97009696
return
97019697
try await uniffiRustCallAsync(
97029698
rustFutureFunc: {
97039699
uniffi_matrix_sdk_ffi_fn_method_timeline_toggle_reaction(
97049700
self.uniffiClonePointer(),
9705-
FfiConverterString.lower(uniqueId),FfiConverterString.lower(key)
9701+
FfiConverterTypeEventOrTransactionId.lower(itemId),FfiConverterString.lower(key)
97069702
)
97079703
},
97089704
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_void,
@@ -10205,7 +10201,10 @@ public protocol TimelineItemProtocol : AnyObject {
1020510201

1020610202
func fmtDebug() -> String
1020710203

10208-
func uniqueId() -> String
10204+
/**
10205+
* An opaque unique identifier for this timeline item.
10206+
*/
10207+
func uniqueId() -> TimelineUniqueId
1020910208

1021010209
}
1021110210

@@ -10271,8 +10270,11 @@ open func fmtDebug() -> String {
1027110270
})
1027210271
}
1027310272

10274-
open func uniqueId() -> String {
10275-
return try! FfiConverterString.lift(try! rustCall() {
10273+
/**
10274+
* An opaque unique identifier for this timeline item.
10275+
*/
10276+
open func uniqueId() -> TimelineUniqueId {
10277+
return try! FfiConverterTypeTimelineUniqueId.lift(try! rustCall() {
1027610278
uniffi_matrix_sdk_ffi_fn_method_timelineitem_unique_id(self.uniffiClonePointer(),$0
1027710279
)
1027810280
})
@@ -15409,6 +15411,55 @@ public func FfiConverterTypeThumbnailInfo_lower(_ value: ThumbnailInfo) -> RustB
1540915411
}
1541015412

1541115413

15414+
public struct TimelineUniqueId {
15415+
public var id: String
15416+
15417+
// Default memberwise initializers are never public by default, so we
15418+
// declare one manually.
15419+
public init(id: String) {
15420+
self.id = id
15421+
}
15422+
}
15423+
15424+
15425+
15426+
extension TimelineUniqueId: Equatable, Hashable {
15427+
public static func ==(lhs: TimelineUniqueId, rhs: TimelineUniqueId) -> Bool {
15428+
if lhs.id != rhs.id {
15429+
return false
15430+
}
15431+
return true
15432+
}
15433+
15434+
public func hash(into hasher: inout Hasher) {
15435+
hasher.combine(id)
15436+
}
15437+
}
15438+
15439+
15440+
public struct FfiConverterTypeTimelineUniqueId: FfiConverterRustBuffer {
15441+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TimelineUniqueId {
15442+
return
15443+
try TimelineUniqueId(
15444+
id: FfiConverterString.read(from: &buf)
15445+
)
15446+
}
15447+
15448+
public static func write(_ value: TimelineUniqueId, into buf: inout [UInt8]) {
15449+
FfiConverterString.write(value.id, into: &buf)
15450+
}
15451+
}
15452+
15453+
15454+
public func FfiConverterTypeTimelineUniqueId_lift(_ buf: RustBuffer) throws -> TimelineUniqueId {
15455+
return try FfiConverterTypeTimelineUniqueId.lift(buf)
15456+
}
15457+
15458+
public func FfiConverterTypeTimelineUniqueId_lower(_ value: TimelineUniqueId) -> RustBuffer {
15459+
return FfiConverterTypeTimelineUniqueId.lower(value)
15460+
}
15461+
15462+
1541215463
public struct TracingConfiguration {
1541315464
/**
1541415465
* A filter line following the [RUST_LOG format].
@@ -19623,6 +19674,121 @@ extension OidcError: Foundation.LocalizedError {
1962319674
}
1962419675
}
1962519676

19677+
// Note that we don't yet support `indirect` for enums.
19678+
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
19679+
19680+
public enum OidcPrompt {
19681+
19682+
/**
19683+
* The Authorization Server must not display any authentication or consent
19684+
* user interface pages.
19685+
*/
19686+
case none
19687+
/**
19688+
* The Authorization Server should prompt the End-User for
19689+
* reauthentication.
19690+
*/
19691+
case login
19692+
/**
19693+
* The Authorization Server should prompt the End-User for consent before
19694+
* returning information to the Client.
19695+
*/
19696+
case consent
19697+
/**
19698+
* The Authorization Server should prompt the End-User to select a user
19699+
* account.
19700+
*
19701+
* This enables an End-User who has multiple accounts at the Authorization
19702+
* Server to select amongst the multiple accounts that they might have
19703+
* current sessions for.
19704+
*/
19705+
case selectAccount
19706+
/**
19707+
* The Authorization Server should prompt the End-User to create a user
19708+
* account.
19709+
*
19710+
* Defined in [Initiating User Registration via OpenID Connect](https://openid.net/specs/openid-connect-prompt-create-1_0.html).
19711+
*/
19712+
case create
19713+
/**
19714+
* An unknown value.
19715+
*/
19716+
case unknown(value: String
19717+
)
19718+
}
19719+
19720+
19721+
public struct FfiConverterTypeOidcPrompt: FfiConverterRustBuffer {
19722+
typealias SwiftType = OidcPrompt
19723+
19724+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> OidcPrompt {
19725+
let variant: Int32 = try readInt(&buf)
19726+
switch variant {
19727+
19728+
case 1: return .none
19729+
19730+
case 2: return .login
19731+
19732+
case 3: return .consent
19733+
19734+
case 4: return .selectAccount
19735+
19736+
case 5: return .create
19737+
19738+
case 6: return .unknown(value: try FfiConverterString.read(from: &buf)
19739+
)
19740+
19741+
default: throw UniffiInternalError.unexpectedEnumCase
19742+
}
19743+
}
19744+
19745+
public static func write(_ value: OidcPrompt, into buf: inout [UInt8]) {
19746+
switch value {
19747+
19748+
19749+
case .none:
19750+
writeInt(&buf, Int32(1))
19751+
19752+
19753+
case .login:
19754+
writeInt(&buf, Int32(2))
19755+
19756+
19757+
case .consent:
19758+
writeInt(&buf, Int32(3))
19759+
19760+
19761+
case .selectAccount:
19762+
writeInt(&buf, Int32(4))
19763+
19764+
19765+
case .create:
19766+
writeInt(&buf, Int32(5))
19767+
19768+
19769+
case let .unknown(value):
19770+
writeInt(&buf, Int32(6))
19771+
FfiConverterString.write(value, into: &buf)
19772+
19773+
}
19774+
}
19775+
}
19776+
19777+
19778+
public func FfiConverterTypeOidcPrompt_lift(_ buf: RustBuffer) throws -> OidcPrompt {
19779+
return try FfiConverterTypeOidcPrompt.lift(buf)
19780+
}
19781+
19782+
public func FfiConverterTypeOidcPrompt_lower(_ value: OidcPrompt) -> RustBuffer {
19783+
return FfiConverterTypeOidcPrompt.lower(value)
19784+
}
19785+
19786+
19787+
19788+
extension OidcPrompt: Equatable, Hashable {}
19789+
19790+
19791+
1962619792
// Note that we don't yet support `indirect` for enums.
1962719793
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
1962819794

@@ -27869,7 +28035,7 @@ private var initializationResult: InitializationResult = {
2786928035
if (uniffi_matrix_sdk_ffi_checksum_method_roommessageeventcontentwithoutrelation_with_mentions() != 8867) {
2787028036
return InitializationResult.apiChecksumMismatch
2787128037
}
27872-
if (uniffi_matrix_sdk_ffi_checksum_method_client_abort_oidc_login() != 22230) {
28038+
if (uniffi_matrix_sdk_ffi_checksum_method_client_abort_oidc_auth() != 6754) {
2787328039
return InitializationResult.apiChecksumMismatch
2787428040
}
2787528041
if (uniffi_matrix_sdk_ffi_checksum_method_client_account_data() != 50433) {
@@ -28052,7 +28218,7 @@ private var initializationResult: InitializationResult = {
2805228218
if (uniffi_matrix_sdk_ffi_checksum_method_client_upload_media() != 51195) {
2805328219
return InitializationResult.apiChecksumMismatch
2805428220
}
28055-
if (uniffi_matrix_sdk_ffi_checksum_method_client_url_for_oidc_login() != 43171) {
28221+
if (uniffi_matrix_sdk_ffi_checksum_method_client_url_for_oidc() != 30079) {
2805628222
return InitializationResult.apiChecksumMismatch
2805728223
}
2805828224
if (uniffi_matrix_sdk_ffi_checksum_method_client_user_id() != 40531) {
@@ -28787,7 +28953,7 @@ private var initializationResult: InitializationResult = {
2878728953
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_subscribe_to_back_pagination_status() != 46161) {
2878828954
return InitializationResult.apiChecksumMismatch
2878928955
}
28790-
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_toggle_reaction() != 62959) {
28956+
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_toggle_reaction() != 29303) {
2879128957
return InitializationResult.apiChecksumMismatch
2879228958
}
2879328959
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_unpin_event() != 52414) {
@@ -28841,7 +29007,7 @@ private var initializationResult: InitializationResult = {
2884129007
if (uniffi_matrix_sdk_ffi_checksum_method_timelineitem_fmt_debug() != 38094) {
2884229008
return InitializationResult.apiChecksumMismatch
2884329009
}
28844-
if (uniffi_matrix_sdk_ffi_checksum_method_timelineitem_unique_id() != 30409) {
29010+
if (uniffi_matrix_sdk_ffi_checksum_method_timelineitem_unique_id() != 39945) {
2884529011
return InitializationResult.apiChecksumMismatch
2884629012
}
2884729013
if (uniffi_matrix_sdk_ffi_checksum_method_unreadnotificationscount_has_notifications() != 33024) {

0 commit comments

Comments
 (0)