@@ -581,7 +581,7 @@ public protocol ClientProtocol : AnyObject {
581
581
* Aborts an existing OIDC login operation that might have been cancelled,
582
582
* failed etc.
583
583
*/
584
- func abortOidcLogin (authorizationData: OidcAuthorizationData) async
584
+ func abortOidcAuth (authorizationData: OidcAuthorizationData) async
585
585
586
586
/**
587
587
* Get the content of the event of the given type out of the account data
@@ -866,12 +866,12 @@ public protocol ClientProtocol : AnyObject {
866
866
func uploadMedia(mimeType: String, data: Data, progressWatcher: ProgressWatcher?) async throws -> String
867
867
868
868
/**
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
870
870
* view has succeeded, call `login_with_oidc_callback` with the callback it
871
871
* 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.
873
873
*/
874
- func urlForOidcLogin (oidcConfiguration: OidcConfiguration) async throws -> OidcAuthorizationData
874
+ func urlForOidc (oidcConfiguration: OidcConfiguration, prompt: OidcPrompt ) async throws -> OidcAuthorizationData
875
875
876
876
func userId() throws -> String
877
877
@@ -927,11 +927,11 @@ open class Client:
927
927
* Aborts an existing OIDC login operation that might have been cancelled,
928
928
* failed etc.
929
929
*/
930
- open func abortOidcLogin (authorizationData: OidcAuthorizationData)async {
930
+ open func abortOidcAuth (authorizationData: OidcAuthorizationData)async {
931
931
return
932
932
try! await uniffiRustCallAsync(
933
933
rustFutureFunc: {
934
- uniffi_matrix_sdk_ffi_fn_method_client_abort_oidc_login (
934
+ uniffi_matrix_sdk_ffi_fn_method_client_abort_oidc_auth (
935
935
self.uniffiClonePointer(),
936
936
FfiConverterTypeOidcAuthorizationData_lower(authorizationData)
937
937
)
@@ -1975,18 +1975,18 @@ open func uploadMedia(mimeType: String, data: Data, progressWatcher: ProgressWat
1975
1975
}
1976
1976
1977
1977
/**
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
1979
1979
* view has succeeded, call `login_with_oidc_callback` with the callback it
1980
1980
* 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.
1982
1982
*/
1983
- open func urlForOidcLogin (oidcConfiguration: OidcConfiguration)async throws -> OidcAuthorizationData {
1983
+ open func urlForOidc (oidcConfiguration: OidcConfiguration, prompt: OidcPrompt )async throws -> OidcAuthorizationData {
1984
1984
return
1985
1985
try await uniffiRustCallAsync(
1986
1986
rustFutureFunc: {
1987
- uniffi_matrix_sdk_ffi_fn_method_client_url_for_oidc_login (
1987
+ uniffi_matrix_sdk_ffi_fn_method_client_url_for_oidc (
1988
1988
self.uniffiClonePointer(),
1989
- FfiConverterTypeOidcConfiguration.lower(oidcConfiguration)
1989
+ FfiConverterTypeOidcConfiguration.lower(oidcConfiguration),FfiConverterTypeOidcPrompt.lower(prompt)
1990
1990
)
1991
1991
},
1992
1992
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_pointer,
@@ -9127,19 +9127,17 @@ public protocol TimelineProtocol : AnyObject {
9127
9127
/**
9128
9128
* Toggle a reaction on an event.
9129
9129
*
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
- *
9134
9130
* Adds or redacts a reaction based on the state of the reaction at the
9135
9131
* time it is called.
9136
9132
*
9133
+ * This method works both on local echoes and remote items.
9134
+ *
9137
9135
* When redacting a previous reaction, the redaction reason is not set.
9138
9136
*
9139
9137
* Ensures that only one reaction is sent at a time to avoid race
9140
9138
* conditions and spamming the homeserver with requests.
9141
9139
*/
9142
- func toggleReaction(uniqueId: String , key: String) async throws
9140
+ func toggleReaction(itemId: EventOrTransactionId , key: String) async throws
9143
9141
9144
9142
/**
9145
9143
* Adds a new pinned event by sending an updated `m.room.pinned_events`
@@ -9684,25 +9682,23 @@ open func subscribeToBackPaginationStatus(listener: PaginationStatusListener)asy
9684
9682
/**
9685
9683
* Toggle a reaction on an event.
9686
9684
*
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
- *
9691
9685
* Adds or redacts a reaction based on the state of the reaction at the
9692
9686
* time it is called.
9693
9687
*
9688
+ * This method works both on local echoes and remote items.
9689
+ *
9694
9690
* When redacting a previous reaction, the redaction reason is not set.
9695
9691
*
9696
9692
* Ensures that only one reaction is sent at a time to avoid race
9697
9693
* conditions and spamming the homeserver with requests.
9698
9694
*/
9699
- open func toggleReaction(uniqueId: String , key: String)async throws {
9695
+ open func toggleReaction(itemId: EventOrTransactionId , key: String)async throws {
9700
9696
return
9701
9697
try await uniffiRustCallAsync(
9702
9698
rustFutureFunc: {
9703
9699
uniffi_matrix_sdk_ffi_fn_method_timeline_toggle_reaction(
9704
9700
self.uniffiClonePointer(),
9705
- FfiConverterString .lower(uniqueId ),FfiConverterString.lower(key)
9701
+ FfiConverterTypeEventOrTransactionId .lower(itemId ),FfiConverterString.lower(key)
9706
9702
)
9707
9703
},
9708
9704
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_void,
@@ -10205,7 +10201,10 @@ public protocol TimelineItemProtocol : AnyObject {
10205
10201
10206
10202
func fmtDebug() -> String
10207
10203
10208
- func uniqueId() -> String
10204
+ /**
10205
+ * An opaque unique identifier for this timeline item.
10206
+ */
10207
+ func uniqueId() -> TimelineUniqueId
10209
10208
10210
10209
}
10211
10210
@@ -10271,8 +10270,11 @@ open func fmtDebug() -> String {
10271
10270
})
10272
10271
}
10273
10272
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() {
10276
10278
uniffi_matrix_sdk_ffi_fn_method_timelineitem_unique_id(self.uniffiClonePointer(),$0
10277
10279
)
10278
10280
})
@@ -15409,6 +15411,55 @@ public func FfiConverterTypeThumbnailInfo_lower(_ value: ThumbnailInfo) -> RustB
15409
15411
}
15410
15412
15411
15413
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
+
15412
15463
public struct TracingConfiguration {
15413
15464
/**
15414
15465
* A filter line following the [RUST_LOG format].
@@ -19623,6 +19674,121 @@ extension OidcError: Foundation.LocalizedError {
19623
19674
}
19624
19675
}
19625
19676
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
+
19626
19792
// Note that we don't yet support `indirect` for enums.
19627
19793
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
19628
19794
@@ -27869,7 +28035,7 @@ private var initializationResult: InitializationResult = {
27869
28035
if (uniffi_matrix_sdk_ffi_checksum_method_roommessageeventcontentwithoutrelation_with_mentions() != 8867) {
27870
28036
return InitializationResult.apiChecksumMismatch
27871
28037
}
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 ) {
27873
28039
return InitializationResult.apiChecksumMismatch
27874
28040
}
27875
28041
if (uniffi_matrix_sdk_ffi_checksum_method_client_account_data() != 50433) {
@@ -28052,7 +28218,7 @@ private var initializationResult: InitializationResult = {
28052
28218
if (uniffi_matrix_sdk_ffi_checksum_method_client_upload_media() != 51195) {
28053
28219
return InitializationResult.apiChecksumMismatch
28054
28220
}
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 ) {
28056
28222
return InitializationResult.apiChecksumMismatch
28057
28223
}
28058
28224
if (uniffi_matrix_sdk_ffi_checksum_method_client_user_id() != 40531) {
@@ -28787,7 +28953,7 @@ private var initializationResult: InitializationResult = {
28787
28953
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_subscribe_to_back_pagination_status() != 46161) {
28788
28954
return InitializationResult.apiChecksumMismatch
28789
28955
}
28790
- if (uniffi_matrix_sdk_ffi_checksum_method_timeline_toggle_reaction() != 62959 ) {
28956
+ if (uniffi_matrix_sdk_ffi_checksum_method_timeline_toggle_reaction() != 29303 ) {
28791
28957
return InitializationResult.apiChecksumMismatch
28792
28958
}
28793
28959
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_unpin_event() != 52414) {
@@ -28841,7 +29007,7 @@ private var initializationResult: InitializationResult = {
28841
29007
if (uniffi_matrix_sdk_ffi_checksum_method_timelineitem_fmt_debug() != 38094) {
28842
29008
return InitializationResult.apiChecksumMismatch
28843
29009
}
28844
- if (uniffi_matrix_sdk_ffi_checksum_method_timelineitem_unique_id() != 30409 ) {
29010
+ if (uniffi_matrix_sdk_ffi_checksum_method_timelineitem_unique_id() != 39945 ) {
28845
29011
return InitializationResult.apiChecksumMismatch
28846
29012
}
28847
29013
if (uniffi_matrix_sdk_ffi_checksum_method_unreadnotificationscount_has_notifications() != 33024) {
0 commit comments