@@ -867,8 +867,25 @@ public protocol ClientProtocol : AnyObject {
867
867
868
868
func ignoredUsers() async throws -> [String]
869
869
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
+ */
870
877
func joinRoomById(roomId: String) async throws -> Room
871
878
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
+
872
889
/**
873
890
* Login using a username and password.
874
891
*/
@@ -886,9 +903,10 @@ public protocol ClientProtocol : AnyObject {
886
903
func removeAvatar() async throws
887
904
888
905
/**
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.
890
908
*/
891
- func resolveRoomAlias(roomAlias: String) async throws -> String
909
+ func resolveRoomAlias(roomAlias: String) async throws -> ResolvedRoomAlias
892
910
893
911
/**
894
912
* Restores the client from a `Session`.
@@ -1296,6 +1314,13 @@ open func ignoredUsers()async throws -> [String] {
1296
1314
)
1297
1315
}
1298
1316
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
+ */
1299
1324
open func joinRoomById(roomId: String)async throws -> Room {
1300
1325
return
1301
1326
try await uniffiRustCallAsync(
@@ -1313,6 +1338,31 @@ open func joinRoomById(roomId: String)async throws -> Room {
1313
1338
)
1314
1339
}
1315
1340
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
+
1316
1366
/**
1317
1367
* Login using a username and password.
1318
1368
*/
@@ -1390,9 +1440,10 @@ open func removeAvatar()async throws {
1390
1440
}
1391
1441
1392
1442
/**
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.
1394
1445
*/
1395
- open func resolveRoomAlias(roomAlias: String)async throws -> String {
1446
+ open func resolveRoomAlias(roomAlias: String)async throws -> ResolvedRoomAlias {
1396
1447
return
1397
1448
try await uniffiRustCallAsync(
1398
1449
rustFutureFunc: {
@@ -1404,7 +1455,7 @@ open func resolveRoomAlias(roomAlias: String)async throws -> String {
1404
1455
pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer,
1405
1456
completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer,
1406
1457
freeFunc: ffi_matrix_sdk_ffi_rust_future_free_rust_buffer,
1407
- liftFunc: FfiConverterString .lift,
1458
+ liftFunc: FfiConverterTypeResolvedRoomAlias .lift,
1408
1459
errorHandler: FfiConverterTypeClientError.lift
1409
1460
)
1410
1461
}
@@ -6100,8 +6151,6 @@ public protocol RoomListServiceProtocol : AnyObject {
6100
6151
6101
6152
func applyInput(input: RoomListInput) async throws
6102
6153
6103
- func invites() async throws -> RoomList
6104
-
6105
6154
func room(roomId: String) async throws -> RoomListItem
6106
6155
6107
6156
func state(listener: RoomListServiceStateListener) -> TaskHandle
@@ -6185,23 +6234,6 @@ open func applyInput(input: RoomListInput)async throws {
6185
6234
)
6186
6235
}
6187
6236
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
-
6205
6237
open func room(roomId: String)async throws -> RoomListItem {
6206
6238
return
6207
6239
try await uniffiRustCallAsync(
@@ -7267,8 +7299,6 @@ public protocol SyncServiceBuilderProtocol : AnyObject {
7267
7299
7268
7300
func withCrossProcessLock(appIdentifier: String?) -> SyncServiceBuilder
7269
7301
7270
- func withUnifiedInvitesInRoomList(withUnifiedInvites: Bool) -> SyncServiceBuilder
7271
-
7272
7302
func withUtdHook(delegate: UnableToDecryptDelegate) -> SyncServiceBuilder
7273
7303
7274
7304
}
@@ -7339,14 +7369,6 @@ open func withCrossProcessLock(appIdentifier: String?) -> SyncServiceBuilder {
7339
7369
})
7340
7370
}
7341
7371
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
-
7350
7372
open func withUtdHook(delegate: UnableToDecryptDelegate) -> SyncServiceBuilder {
7351
7373
return try! FfiConverterTypeSyncServiceBuilder.lift(try! rustCall() {
7352
7374
uniffi_matrix_sdk_ffi_fn_method_syncservicebuilder_with_utd_hook(self.uniffiClonePointer(),
@@ -11135,6 +11157,78 @@ public func FfiConverterTypeRequiredState_lower(_ value: RequiredState) -> RustB
11135
11157
}
11136
11158
11137
11159
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
+
11138
11232
public struct RoomDescription {
11139
11233
public var roomId: String
11140
11234
public var name: String?
@@ -17439,6 +17533,7 @@ public enum RoomListEntriesDynamicFilterKind {
17439
17533
case any(filters: [RoomListEntriesDynamicFilterKind]
17440
17534
)
17441
17535
case nonLeft
17536
+ case joined
17442
17537
case unread
17443
17538
case favourite
17444
17539
case invite
@@ -17467,21 +17562,23 @@ public struct FfiConverterTypeRoomListEntriesDynamicFilterKind: FfiConverterRust
17467
17562
17468
17563
case 3: return .nonLeft
17469
17564
17470
- case 4: return .unread
17565
+ case 4: return .joined
17471
17566
17472
- case 5: return .favourite
17567
+ case 5: return .unread
17473
17568
17474
- case 6: return .invite
17569
+ case 6: return .favourite
17475
17570
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)
17477
17574
)
17478
17575
17479
- case 8 : return .none
17576
+ case 9 : return .none
17480
17577
17481
- case 9 : return .normalizedMatchRoomName(pattern: try FfiConverterString.read(from: &buf)
17578
+ case 10 : return .normalizedMatchRoomName(pattern: try FfiConverterString.read(from: &buf)
17482
17579
)
17483
17580
17484
- case 10 : return .fuzzyMatchRoomName(pattern: try FfiConverterString.read(from: &buf)
17581
+ case 11 : return .fuzzyMatchRoomName(pattern: try FfiConverterString.read(from: &buf)
17485
17582
)
17486
17583
17487
17584
default: throw UniffiInternalError.unexpectedEnumCase
@@ -17506,34 +17603,38 @@ public struct FfiConverterTypeRoomListEntriesDynamicFilterKind: FfiConverterRust
17506
17603
writeInt(&buf, Int32(3))
17507
17604
17508
17605
17509
- case .unread :
17606
+ case .joined :
17510
17607
writeInt(&buf, Int32(4))
17511
17608
17512
17609
17513
- case .favourite :
17610
+ case .unread :
17514
17611
writeInt(&buf, Int32(5))
17515
17612
17516
17613
17517
- case .invite :
17614
+ case .favourite :
17518
17615
writeInt(&buf, Int32(6))
17519
17616
17520
17617
17521
- case let .category(expect) :
17618
+ case .invite :
17522
17619
writeInt(&buf, Int32(7))
17620
+
17621
+
17622
+ case let .category(expect):
17623
+ writeInt(&buf, Int32(8))
17523
17624
FfiConverterTypeRoomListFilterCategory.write(expect, into: &buf)
17524
17625
17525
17626
17526
17627
case .none:
17527
- writeInt(&buf, Int32(8 ))
17628
+ writeInt(&buf, Int32(9 ))
17528
17629
17529
17630
17530
17631
case let .normalizedMatchRoomName(pattern):
17531
- writeInt(&buf, Int32(9 ))
17632
+ writeInt(&buf, Int32(10 ))
17532
17633
FfiConverterString.write(pattern, into: &buf)
17533
17634
17534
17635
17535
17636
case let .fuzzyMatchRoomName(pattern):
17536
- writeInt(&buf, Int32(10 ))
17637
+ writeInt(&buf, Int32(11 ))
17537
17638
FfiConverterString.write(pattern, into: &buf)
17538
17639
17539
17640
}
@@ -23756,7 +23857,10 @@ private var initializationResult: InitializationResult {
23756
23857
if (uniffi_matrix_sdk_ffi_checksum_method_client_ignored_users() != 49620) {
23757
23858
return InitializationResult.apiChecksumMismatch
23758
23859
}
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) {
23760
23864
return InitializationResult.apiChecksumMismatch
23761
23865
}
23762
23866
if (uniffi_matrix_sdk_ffi_checksum_method_client_login() != 33276) {
@@ -23771,7 +23875,7 @@ private var initializationResult: InitializationResult {
23771
23875
if (uniffi_matrix_sdk_ffi_checksum_method_client_remove_avatar() != 29033) {
23772
23876
return InitializationResult.apiChecksumMismatch
23773
23877
}
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 ) {
23775
23879
return InitializationResult.apiChecksumMismatch
23776
23880
}
23777
23881
if (uniffi_matrix_sdk_ffi_checksum_method_client_restore_session() != 40455) {
@@ -24344,9 +24448,6 @@ private var initializationResult: InitializationResult {
24344
24448
if (uniffi_matrix_sdk_ffi_checksum_method_roomlistservice_apply_input() != 31607) {
24345
24449
return InitializationResult.apiChecksumMismatch
24346
24450
}
24347
- if (uniffi_matrix_sdk_ffi_checksum_method_roomlistservice_invites() != 18531) {
24348
- return InitializationResult.apiChecksumMismatch
24349
- }
24350
24451
if (uniffi_matrix_sdk_ffi_checksum_method_roomlistservice_room() != 11566) {
24351
24452
return InitializationResult.apiChecksumMismatch
24352
24453
}
@@ -24422,9 +24523,6 @@ private var initializationResult: InitializationResult {
24422
24523
if (uniffi_matrix_sdk_ffi_checksum_method_syncservicebuilder_with_cross_process_lock() != 31599) {
24423
24524
return InitializationResult.apiChecksumMismatch
24424
24525
}
24425
- if (uniffi_matrix_sdk_ffi_checksum_method_syncservicebuilder_with_unified_invites_in_room_list() != 19788) {
24426
- return InitializationResult.apiChecksumMismatch
24427
- }
24428
24526
if (uniffi_matrix_sdk_ffi_checksum_method_syncservicebuilder_with_utd_hook() != 61858) {
24429
24527
return InitializationResult.apiChecksumMismatch
24430
24528
}
0 commit comments