Skip to content

Commit edfd1bb

Browse files
committed
Bump to version v1.1.66 (matrix-rust-sdk/main e709cca2f5207262c6ae72ef0a3df10f54470e8c)
1 parent 89a608a commit edfd1bb

File tree

2 files changed

+156
-58
lines changed

2 files changed

+156
-58
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.5
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33
import PackageDescription
4-
let checksum = "c14248b8f89a32a37b210284ce1d41264d92727b1d09f0285b0ff09472ad27cf"
5-
let version = "v1.1.65"
4+
let checksum = "c93d13be80d129dd029ad1aa9842c888a27ea02950a888059255a6bb87676c54"
5+
let version = "v1.1.66"
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_ffi.swift

Lines changed: 154 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -867,8 +867,25 @@ public protocol ClientProtocol : AnyObject {
867867

868868
func ignoredUsers() async throws -> [String]
869869

870+
/**
871+
* Join a room by its ID.
872+
*
873+
* Use this method when the homeserver already knows of the given room ID.
874+
* Otherwise use `join_room_by_id_or_alias` so you can pass a list of
875+
* server names for the homeserver to find the room.
876+
*/
870877
func joinRoomById(roomId: String) async throws -> Room
871878

879+
/**
880+
* Join a room by its ID or alias.
881+
*
882+
* When supplying the room's ID, you can also supply a list of server names
883+
* for the homeserver to find the room. Typically these server names
884+
* come from a permalink's `via` parameters, or from resolving a room's
885+
* alias into an ID.
886+
*/
887+
func joinRoomByIdOrAlias(roomIdOrAlias: String, serverNames: [String]) async throws -> Room
888+
872889
/**
873890
* Login using a username and password.
874891
*/
@@ -886,9 +903,10 @@ public protocol ClientProtocol : AnyObject {
886903
func removeAvatar() async throws
887904

888905
/**
889-
* Resolves the given room alias to a room id, if possible.
906+
* Resolves the given room alias to a room ID (and a list of servers), if
907+
* possible.
890908
*/
891-
func resolveRoomAlias(roomAlias: String) async throws -> String
909+
func resolveRoomAlias(roomAlias: String) async throws -> ResolvedRoomAlias
892910

893911
/**
894912
* Restores the client from a `Session`.
@@ -1296,6 +1314,13 @@ open func ignoredUsers()async throws -> [String] {
12961314
)
12971315
}
12981316

1317+
/**
1318+
* Join a room by its ID.
1319+
*
1320+
* Use this method when the homeserver already knows of the given room ID.
1321+
* Otherwise use `join_room_by_id_or_alias` so you can pass a list of
1322+
* server names for the homeserver to find the room.
1323+
*/
12991324
open func joinRoomById(roomId: String)async throws -> Room {
13001325
return
13011326
try await uniffiRustCallAsync(
@@ -1313,6 +1338,31 @@ open func joinRoomById(roomId: String)async throws -> Room {
13131338
)
13141339
}
13151340

1341+
/**
1342+
* Join a room by its ID or alias.
1343+
*
1344+
* When supplying the room's ID, you can also supply a list of server names
1345+
* for the homeserver to find the room. Typically these server names
1346+
* come from a permalink's `via` parameters, or from resolving a room's
1347+
* alias into an ID.
1348+
*/
1349+
open func joinRoomByIdOrAlias(roomIdOrAlias: String, serverNames: [String])async throws -> Room {
1350+
return
1351+
try await uniffiRustCallAsync(
1352+
rustFutureFunc: {
1353+
uniffi_matrix_sdk_ffi_fn_method_client_join_room_by_id_or_alias(
1354+
self.uniffiClonePointer(),
1355+
FfiConverterString.lower(roomIdOrAlias),FfiConverterSequenceString.lower(serverNames)
1356+
)
1357+
},
1358+
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_pointer,
1359+
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_pointer,
1360+
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_pointer,
1361+
liftFunc: FfiConverterTypeRoom.lift,
1362+
errorHandler: FfiConverterTypeClientError.lift
1363+
)
1364+
}
1365+
13161366
/**
13171367
* Login using a username and password.
13181368
*/
@@ -1390,9 +1440,10 @@ open func removeAvatar()async throws {
13901440
}
13911441

13921442
/**
1393-
* Resolves the given room alias to a room id, if possible.
1443+
* Resolves the given room alias to a room ID (and a list of servers), if
1444+
* possible.
13941445
*/
1395-
open func resolveRoomAlias(roomAlias: String)async throws -> String {
1446+
open func resolveRoomAlias(roomAlias: String)async throws -> ResolvedRoomAlias {
13961447
return
13971448
try await uniffiRustCallAsync(
13981449
rustFutureFunc: {
@@ -1404,7 +1455,7 @@ open func resolveRoomAlias(roomAlias: String)async throws -> String {
14041455
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer,
14051456
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer,
14061457
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_rust_buffer,
1407-
liftFunc: FfiConverterString.lift,
1458+
liftFunc: FfiConverterTypeResolvedRoomAlias.lift,
14081459
errorHandler: FfiConverterTypeClientError.lift
14091460
)
14101461
}
@@ -6100,8 +6151,6 @@ public protocol RoomListServiceProtocol : AnyObject {
61006151

61016152
func applyInput(input: RoomListInput) async throws
61026153

6103-
func invites() async throws -> RoomList
6104-
61056154
func room(roomId: String) async throws -> RoomListItem
61066155

61076156
func state(listener: RoomListServiceStateListener) -> TaskHandle
@@ -6185,23 +6234,6 @@ open func applyInput(input: RoomListInput)async throws {
61856234
)
61866235
}
61876236

6188-
open func invites()async throws -> RoomList {
6189-
return
6190-
try await uniffiRustCallAsync(
6191-
rustFutureFunc: {
6192-
uniffi_matrix_sdk_ffi_fn_method_roomlistservice_invites(
6193-
self.uniffiClonePointer()
6194-
6195-
)
6196-
},
6197-
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_pointer,
6198-
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_pointer,
6199-
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_pointer,
6200-
liftFunc: FfiConverterTypeRoomList.lift,
6201-
errorHandler: FfiConverterTypeRoomListError.lift
6202-
)
6203-
}
6204-
62056237
open func room(roomId: String)async throws -> RoomListItem {
62066238
return
62076239
try await uniffiRustCallAsync(
@@ -7267,8 +7299,6 @@ public protocol SyncServiceBuilderProtocol : AnyObject {
72677299

72687300
func withCrossProcessLock(appIdentifier: String?) -> SyncServiceBuilder
72697301

7270-
func withUnifiedInvitesInRoomList(withUnifiedInvites: Bool) -> SyncServiceBuilder
7271-
72727302
func withUtdHook(delegate: UnableToDecryptDelegate) -> SyncServiceBuilder
72737303

72747304
}
@@ -7339,14 +7369,6 @@ open func withCrossProcessLock(appIdentifier: String?) -> SyncServiceBuilder {
73397369
})
73407370
}
73417371

7342-
open func withUnifiedInvitesInRoomList(withUnifiedInvites: Bool) -> SyncServiceBuilder {
7343-
return try! FfiConverterTypeSyncServiceBuilder.lift(try! rustCall() {
7344-
uniffi_matrix_sdk_ffi_fn_method_syncservicebuilder_with_unified_invites_in_room_list(self.uniffiClonePointer(),
7345-
FfiConverterBool.lower(withUnifiedInvites),$0
7346-
)
7347-
})
7348-
}
7349-
73507372
open func withUtdHook(delegate: UnableToDecryptDelegate) -> SyncServiceBuilder {
73517373
return try! FfiConverterTypeSyncServiceBuilder.lift(try! rustCall() {
73527374
uniffi_matrix_sdk_ffi_fn_method_syncservicebuilder_with_utd_hook(self.uniffiClonePointer(),
@@ -11135,6 +11157,78 @@ public func FfiConverterTypeRequiredState_lower(_ value: RequiredState) -> RustB
1113511157
}
1113611158

1113711159

11160+
/**
11161+
* Information about a room, that was resolved from a room alias.
11162+
*/
11163+
public struct ResolvedRoomAlias {
11164+
/**
11165+
* The room ID that the alias resolved to.
11166+
*/
11167+
public var roomId: String
11168+
/**
11169+
* A list of servers that can be used to find the room by its room ID.
11170+
*/
11171+
public var servers: [String]
11172+
11173+
// Default memberwise initializers are never public by default, so we
11174+
// declare one manually.
11175+
public init(
11176+
/**
11177+
* The room ID that the alias resolved to.
11178+
*/roomId: String,
11179+
/**
11180+
* A list of servers that can be used to find the room by its room ID.
11181+
*/servers: [String]) {
11182+
self.roomId = roomId
11183+
self.servers = servers
11184+
}
11185+
}
11186+
11187+
11188+
11189+
extension ResolvedRoomAlias: Equatable, Hashable {
11190+
public static func ==(lhs: ResolvedRoomAlias, rhs: ResolvedRoomAlias) -> Bool {
11191+
if lhs.roomId != rhs.roomId {
11192+
return false
11193+
}
11194+
if lhs.servers != rhs.servers {
11195+
return false
11196+
}
11197+
return true
11198+
}
11199+
11200+
public func hash(into hasher: inout Hasher) {
11201+
hasher.combine(roomId)
11202+
hasher.combine(servers)
11203+
}
11204+
}
11205+
11206+
11207+
public struct FfiConverterTypeResolvedRoomAlias: FfiConverterRustBuffer {
11208+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ResolvedRoomAlias {
11209+
return
11210+
try ResolvedRoomAlias(
11211+
roomId: FfiConverterString.read(from: &buf),
11212+
servers: FfiConverterSequenceString.read(from: &buf)
11213+
)
11214+
}
11215+
11216+
public static func write(_ value: ResolvedRoomAlias, into buf: inout [UInt8]) {
11217+
FfiConverterString.write(value.roomId, into: &buf)
11218+
FfiConverterSequenceString.write(value.servers, into: &buf)
11219+
}
11220+
}
11221+
11222+
11223+
public func FfiConverterTypeResolvedRoomAlias_lift(_ buf: RustBuffer) throws -> ResolvedRoomAlias {
11224+
return try FfiConverterTypeResolvedRoomAlias.lift(buf)
11225+
}
11226+
11227+
public func FfiConverterTypeResolvedRoomAlias_lower(_ value: ResolvedRoomAlias) -> RustBuffer {
11228+
return FfiConverterTypeResolvedRoomAlias.lower(value)
11229+
}
11230+
11231+
1113811232
public struct RoomDescription {
1113911233
public var roomId: String
1114011234
public var name: String?
@@ -17439,6 +17533,7 @@ public enum RoomListEntriesDynamicFilterKind {
1743917533
case any(filters: [RoomListEntriesDynamicFilterKind]
1744017534
)
1744117535
case nonLeft
17536+
case joined
1744217537
case unread
1744317538
case favourite
1744417539
case invite
@@ -17467,21 +17562,23 @@ public struct FfiConverterTypeRoomListEntriesDynamicFilterKind: FfiConverterRust
1746717562

1746817563
case 3: return .nonLeft
1746917564

17470-
case 4: return .unread
17565+
case 4: return .joined
1747117566

17472-
case 5: return .favourite
17567+
case 5: return .unread
1747317568

17474-
case 6: return .invite
17569+
case 6: return .favourite
1747517570

17476-
case 7: return .category(expect: try FfiConverterTypeRoomListFilterCategory.read(from: &buf)
17571+
case 7: return .invite
17572+
17573+
case 8: return .category(expect: try FfiConverterTypeRoomListFilterCategory.read(from: &buf)
1747717574
)
1747817575

17479-
case 8: return .none
17576+
case 9: return .none
1748017577

17481-
case 9: return .normalizedMatchRoomName(pattern: try FfiConverterString.read(from: &buf)
17578+
case 10: return .normalizedMatchRoomName(pattern: try FfiConverterString.read(from: &buf)
1748217579
)
1748317580

17484-
case 10: return .fuzzyMatchRoomName(pattern: try FfiConverterString.read(from: &buf)
17581+
case 11: return .fuzzyMatchRoomName(pattern: try FfiConverterString.read(from: &buf)
1748517582
)
1748617583

1748717584
default: throw UniffiInternalError.unexpectedEnumCase
@@ -17506,34 +17603,38 @@ public struct FfiConverterTypeRoomListEntriesDynamicFilterKind: FfiConverterRust
1750617603
writeInt(&buf, Int32(3))
1750717604

1750817605

17509-
case .unread:
17606+
case .joined:
1751017607
writeInt(&buf, Int32(4))
1751117608

1751217609

17513-
case .favourite:
17610+
case .unread:
1751417611
writeInt(&buf, Int32(5))
1751517612

1751617613

17517-
case .invite:
17614+
case .favourite:
1751817615
writeInt(&buf, Int32(6))
1751917616

1752017617

17521-
case let .category(expect):
17618+
case .invite:
1752217619
writeInt(&buf, Int32(7))
17620+
17621+
17622+
case let .category(expect):
17623+
writeInt(&buf, Int32(8))
1752317624
FfiConverterTypeRoomListFilterCategory.write(expect, into: &buf)
1752417625

1752517626

1752617627
case .none:
17527-
writeInt(&buf, Int32(8))
17628+
writeInt(&buf, Int32(9))
1752817629

1752917630

1753017631
case let .normalizedMatchRoomName(pattern):
17531-
writeInt(&buf, Int32(9))
17632+
writeInt(&buf, Int32(10))
1753217633
FfiConverterString.write(pattern, into: &buf)
1753317634

1753417635

1753517636
case let .fuzzyMatchRoomName(pattern):
17536-
writeInt(&buf, Int32(10))
17637+
writeInt(&buf, Int32(11))
1753717638
FfiConverterString.write(pattern, into: &buf)
1753817639

1753917640
}
@@ -23756,7 +23857,10 @@ private var initializationResult: InitializationResult {
2375623857
if (uniffi_matrix_sdk_ffi_checksum_method_client_ignored_users() != 49620) {
2375723858
return InitializationResult.apiChecksumMismatch
2375823859
}
23759-
if (uniffi_matrix_sdk_ffi_checksum_method_client_join_room_by_id() != 51221) {
23860+
if (uniffi_matrix_sdk_ffi_checksum_method_client_join_room_by_id() != 64032) {
23861+
return InitializationResult.apiChecksumMismatch
23862+
}
23863+
if (uniffi_matrix_sdk_ffi_checksum_method_client_join_room_by_id_or_alias() != 18521) {
2376023864
return InitializationResult.apiChecksumMismatch
2376123865
}
2376223866
if (uniffi_matrix_sdk_ffi_checksum_method_client_login() != 33276) {
@@ -23771,7 +23875,7 @@ private var initializationResult: InitializationResult {
2377123875
if (uniffi_matrix_sdk_ffi_checksum_method_client_remove_avatar() != 29033) {
2377223876
return InitializationResult.apiChecksumMismatch
2377323877
}
23774-
if (uniffi_matrix_sdk_ffi_checksum_method_client_resolve_room_alias() != 27709) {
23878+
if (uniffi_matrix_sdk_ffi_checksum_method_client_resolve_room_alias() != 14306) {
2377523879
return InitializationResult.apiChecksumMismatch
2377623880
}
2377723881
if (uniffi_matrix_sdk_ffi_checksum_method_client_restore_session() != 40455) {
@@ -24344,9 +24448,6 @@ private var initializationResult: InitializationResult {
2434424448
if (uniffi_matrix_sdk_ffi_checksum_method_roomlistservice_apply_input() != 31607) {
2434524449
return InitializationResult.apiChecksumMismatch
2434624450
}
24347-
if (uniffi_matrix_sdk_ffi_checksum_method_roomlistservice_invites() != 18531) {
24348-
return InitializationResult.apiChecksumMismatch
24349-
}
2435024451
if (uniffi_matrix_sdk_ffi_checksum_method_roomlistservice_room() != 11566) {
2435124452
return InitializationResult.apiChecksumMismatch
2435224453
}
@@ -24422,9 +24523,6 @@ private var initializationResult: InitializationResult {
2442224523
if (uniffi_matrix_sdk_ffi_checksum_method_syncservicebuilder_with_cross_process_lock() != 31599) {
2442324524
return InitializationResult.apiChecksumMismatch
2442424525
}
24425-
if (uniffi_matrix_sdk_ffi_checksum_method_syncservicebuilder_with_unified_invites_in_room_list() != 19788) {
24426-
return InitializationResult.apiChecksumMismatch
24427-
}
2442824526
if (uniffi_matrix_sdk_ffi_checksum_method_syncservicebuilder_with_utd_hook() != 61858) {
2442924527
return InitializationResult.apiChecksumMismatch
2443024528
}

0 commit comments

Comments
 (0)