Skip to content

Commit ff732a0

Browse files
committed
Bump to version 25.02.19 (matrix-rust-sdk/main 2eb2ae7959a9af77d2faf11835821ad1d51d7d9f)
1 parent 9b0c2ca commit ff732a0

File tree

4 files changed

+2662
-499
lines changed

4 files changed

+2662
-499
lines changed

Package.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// swift-tools-version:5.5
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33
import PackageDescription
4-
let checksum = "13a62b88a768166c1d436acbe3ae27a436c706043bc45eabacd7412cef527a3a"
5-
let version = "24.12.20"
4+
let checksum = "d6db899fc3e31a986d03004197723fad9a9bd3b8c416da41411ab567ff152f03"
5+
let version = "25.02.19"
66
let url = "https://github.com/matrix-org/matrix-rust-components-swift/releases/download/\(version)/MatrixSDKFFI.xcframework.zip"
77
let package = Package(
88
name: "MatrixRustSDK",

Sources/MatrixRustSDK/matrix_sdk.swift

+7-5
Original file line numberDiff line numberDiff line change
@@ -914,9 +914,10 @@ public enum QrCodeLoginError {
914914

915915

916916
/**
917-
* An error happened while we were communicating with the OIDC provider.
917+
* An error happened while we were communicating with the OAuth 2.0
918+
* authorization server.
918919
*/
919-
case Oidc(message: String)
920+
case Oauth(message: String)
920921

921922
/**
922923
* The other device has signaled to us that the login has failed.
@@ -940,7 +941,8 @@ public enum QrCodeLoginError {
940941

941942
/**
942943
* An error happened while we were trying to discover our user and device
943-
* ID, after we have acquired an access token from the OIDC provider.
944+
* ID, after we have acquired an access token from the OAuth 2.0
945+
* authorization server.
944946
*/
945947
case UserIdDiscovery(message: String)
946948

@@ -974,7 +976,7 @@ public struct FfiConverterTypeQRCodeLoginError: FfiConverterRustBuffer {
974976

975977

976978

977-
case 1: return .Oidc(
979+
case 1: return .Oauth(
978980
message: try FfiConverterString.read(from: &buf)
979981
)
980982

@@ -1021,7 +1023,7 @@ public struct FfiConverterTypeQRCodeLoginError: FfiConverterRustBuffer {
10211023

10221024

10231025

1024-
case .Oidc(_ /* message is ignored*/):
1026+
case .Oauth(_ /* message is ignored*/):
10251027
writeInt(&buf, Int32(1))
10261028
case .LoginFailure(_ /* message is ignored*/):
10271029
writeInt(&buf, Int32(2))

Sources/MatrixRustSDK/matrix_sdk_crypto.swift

+46-55
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
@@ -513,39 +492,42 @@ public func FfiConverterTypeDecryptionSettings_lower(_ value: DecryptionSettings
513492
public enum CollectStrategy {
514493

515494
/**
516-
* Device based sharing strategy.
495+
* Share with all (unblacklisted) devices.
517496
*/
518-
case deviceBasedStrategy(
519-
/**
520-
* If `true`, devices that are not trusted will be excluded from the
521-
* conversation. A device is trusted if any of the following is true:
522-
* - It was manually marked as trusted.
523-
* - It was marked as verified via interactive verification.
524-
* - It is signed by its owner identity, and this identity has been
525-
* trusted via interactive verification.
526-
* - It is the current own device of the user.
527-
*/onlyAllowTrustedDevices: Bool,
528-
/**
529-
* If `true`, and a verified user has an unsigned device, key sharing
530-
* will fail with a
531-
* [`SessionRecipientCollectionError::VerifiedUserHasUnsignedDevice`].
532-
*
533-
* If `true`, and a verified user has replaced their identity, key
534-
* sharing will fail with a
535-
* [`SessionRecipientCollectionError::VerifiedUserChangedIdentity`].
536-
*
537-
* Otherwise, keys are shared with unsigned devices as normal.
538-
*
539-
* Once the problematic devices are blacklisted or whitelisted the
540-
* caller can retry to share a second time.
541-
*/errorOnVerifiedUserProblem: Bool
542-
)
497+
case allDevices
498+
/**
499+
* Share with all devices, except errors for *verified* users cause sharing
500+
* to fail with an error.
501+
*
502+
* In this strategy, if a verified user has an unsigned device,
503+
* key sharing will fail with a
504+
* [`SessionRecipientCollectionError::VerifiedUserHasUnsignedDevice`].
505+
* If a verified user has replaced their identity, key
506+
* sharing will fail with a
507+
* [`SessionRecipientCollectionError::VerifiedUserChangedIdentity`].
508+
*
509+
* Otherwise, keys are shared with unsigned devices as normal.
510+
*
511+
* Once the problematic devices are blacklisted or whitelisted the
512+
* caller can retry to share a second time.
513+
*/
514+
case errorOnVerifiedUserProblem
543515
/**
544516
* Share based on identity. Only distribute to devices signed by their
545517
* owner. If a user has no published identity he will not receive
546518
* any room keys.
547519
*/
548520
case identityBasedStrategy
521+
/**
522+
* Only share keys with devices that we "trust". A device is trusted if any
523+
* of the following is true:
524+
* - It was manually marked as trusted.
525+
* - It was marked as verified via interactive verification.
526+
* - It is signed by its owner identity, and this identity has been
527+
* trusted via interactive verification.
528+
* - It is the current own device of the user.
529+
*/
530+
case onlyTrustedDevices
549531
}
550532

551533

@@ -556,10 +538,13 @@ public struct FfiConverterTypeCollectStrategy: FfiConverterRustBuffer {
556538
let variant: Int32 = try readInt(&buf)
557539
switch variant {
558540

559-
case 1: return .deviceBasedStrategy(onlyAllowTrustedDevices: try FfiConverterBool.read(from: &buf), errorOnVerifiedUserProblem: try FfiConverterBool.read(from: &buf)
560-
)
541+
case 1: return .allDevices
561542

562-
case 2: return .identityBasedStrategy
543+
case 2: return .errorOnVerifiedUserProblem
544+
545+
case 3: return .identityBasedStrategy
546+
547+
case 4: return .onlyTrustedDevices
563548

564549
default: throw UniffiInternalError.unexpectedEnumCase
565550
}
@@ -569,15 +554,21 @@ public struct FfiConverterTypeCollectStrategy: FfiConverterRustBuffer {
569554
switch value {
570555

571556

572-
case let .deviceBasedStrategy(onlyAllowTrustedDevices,errorOnVerifiedUserProblem):
557+
case .allDevices:
573558
writeInt(&buf, Int32(1))
574-
FfiConverterBool.write(onlyAllowTrustedDevices, into: &buf)
575-
FfiConverterBool.write(errorOnVerifiedUserProblem, into: &buf)
576-
577559

578-
case .identityBasedStrategy:
560+
561+
case .errorOnVerifiedUserProblem:
579562
writeInt(&buf, Int32(2))
580563

564+
565+
case .identityBasedStrategy:
566+
writeInt(&buf, Int32(3))
567+
568+
569+
case .onlyTrustedDevices:
570+
writeInt(&buf, Int32(4))
571+
581572
}
582573
}
583574
}

0 commit comments

Comments
 (0)