@@ -7895,6 +7895,11 @@ public protocol RoomPreviewProtocol : AnyObject {
7895
7895
*/
7896
7896
func info() throws -> RoomPreviewInfo
7897
7897
7898
+ /**
7899
+ * Get the user who created the invite, if any.
7900
+ */
7901
+ func inviter() async -> RoomMember?
7902
+
7898
7903
/**
7899
7904
* Leave the room if the room preview state is either joined, invited or
7900
7905
* knocked.
@@ -7960,6 +7965,27 @@ open func info()throws -> RoomPreviewInfo {
7960
7965
})
7961
7966
}
7962
7967
7968
+ /**
7969
+ * Get the user who created the invite, if any.
7970
+ */
7971
+ open func inviter()async -> RoomMember? {
7972
+ return
7973
+ try! await uniffiRustCallAsync(
7974
+ rustFutureFunc: {
7975
+ uniffi_matrix_sdk_ffi_fn_method_roompreview_inviter(
7976
+ self.uniffiClonePointer()
7977
+
7978
+ )
7979
+ },
7980
+ pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_rust_buffer,
7981
+ completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer,
7982
+ freeFunc: ffi_matrix_sdk_ffi_rust_future_free_rust_buffer,
7983
+ liftFunc: FfiConverterOptionTypeRoomMember.lift,
7984
+ errorHandler: nil
7985
+
7986
+ )
7987
+ }
7988
+
7963
7989
/**
7964
7990
* Leave the room if the room preview state is either joined, invited or
7965
7991
* knocked.
@@ -9583,7 +9609,7 @@ public protocol TimelineProtocol : AnyObject {
9583
9609
9584
9610
func sendAudio(url: String, audioInfo: AudioInfo, caption: String?, formattedCaption: FormattedBody?, progressWatcher: ProgressWatcher?, useSendQueue: Bool) -> SendAttachmentJoinHandle
9585
9611
9586
- func sendFile(url: String, fileInfo: FileInfo, progressWatcher: ProgressWatcher?, useSendQueue: Bool) -> SendAttachmentJoinHandle
9612
+ func sendFile(url: String, fileInfo: FileInfo, caption: String?, formattedCaption: FormattedBody?, progressWatcher: ProgressWatcher?, useSendQueue: Bool) -> SendAttachmentJoinHandle
9587
9613
9588
9614
func sendImage(url: String, thumbnailUrl: String?, imageInfo: ImageInfo, caption: String?, formattedCaption: FormattedBody?, progressWatcher: ProgressWatcher?, useSendQueue: Bool) -> SendAttachmentJoinHandle
9589
9615
@@ -9996,11 +10022,13 @@ open func sendAudio(url: String, audioInfo: AudioInfo, caption: String?, formatt
9996
10022
})
9997
10023
}
9998
10024
9999
- open func sendFile(url: String, fileInfo: FileInfo, progressWatcher: ProgressWatcher?, useSendQueue: Bool) -> SendAttachmentJoinHandle {
10025
+ open func sendFile(url: String, fileInfo: FileInfo, caption: String?, formattedCaption: FormattedBody?, progressWatcher: ProgressWatcher?, useSendQueue: Bool) -> SendAttachmentJoinHandle {
10000
10026
return try! FfiConverterTypeSendAttachmentJoinHandle.lift(try! rustCall() {
10001
10027
uniffi_matrix_sdk_ffi_fn_method_timeline_send_file(self.uniffiClonePointer(),
10002
10028
FfiConverterString.lower(url),
10003
10029
FfiConverterTypeFileInfo.lower(fileInfo),
10030
+ FfiConverterOptionString.lower(caption),
10031
+ FfiConverterOptionTypeFormattedBody.lower(formattedCaption),
10004
10032
FfiConverterOptionCallbackInterfaceProgressWatcher.lower(progressWatcher),
10005
10033
FfiConverterBool.lower(useSendQueue),$0
10006
10034
)
@@ -15119,10 +15147,14 @@ public struct RoomPreviewInfo {
15119
15147
* The number of joined members.
15120
15148
*/
15121
15149
public var numJoinedMembers: UInt64
15150
+ /**
15151
+ * The number of active members, if known (joined + invited).
15152
+ */
15153
+ public var numActiveMembers: UInt64?
15122
15154
/**
15123
15155
* The room type (space, custom) or nothing, if it's a regular room.
15124
15156
*/
15125
- public var roomType: String?
15157
+ public var roomType: RoomType
15126
15158
/**
15127
15159
* Is the history world-readable for this room?
15128
15160
*/
@@ -15135,6 +15167,10 @@ public struct RoomPreviewInfo {
15135
15167
* The join rule for this room (private, public, knock, etc.).
15136
15168
*/
15137
15169
public var joinRule: JoinRule
15170
+ /**
15171
+ * Whether the room is direct or not, if known.
15172
+ */
15173
+ public var isDirect: Bool?
15138
15174
15139
15175
// Default memberwise initializers are never public by default, so we
15140
15176
// declare one manually.
@@ -15157,9 +15193,12 @@ public struct RoomPreviewInfo {
15157
15193
/**
15158
15194
* The number of joined members.
15159
15195
*/numJoinedMembers: UInt64,
15196
+ /**
15197
+ * The number of active members, if known (joined + invited).
15198
+ */numActiveMembers: UInt64?,
15160
15199
/**
15161
15200
* The room type (space, custom) or nothing, if it's a regular room.
15162
- */roomType: String? ,
15201
+ */roomType: RoomType ,
15163
15202
/**
15164
15203
* Is the history world-readable for this room?
15165
15204
*/isHistoryWorldReadable: Bool,
@@ -15168,17 +15207,22 @@ public struct RoomPreviewInfo {
15168
15207
*/membership: Membership?,
15169
15208
/**
15170
15209
* The join rule for this room (private, public, knock, etc.).
15171
- */joinRule: JoinRule) {
15210
+ */joinRule: JoinRule,
15211
+ /**
15212
+ * Whether the room is direct or not, if known.
15213
+ */isDirect: Bool?) {
15172
15214
self.roomId = roomId
15173
15215
self.canonicalAlias = canonicalAlias
15174
15216
self.name = name
15175
15217
self.topic = topic
15176
15218
self.avatarUrl = avatarUrl
15177
15219
self.numJoinedMembers = numJoinedMembers
15220
+ self.numActiveMembers = numActiveMembers
15178
15221
self.roomType = roomType
15179
15222
self.isHistoryWorldReadable = isHistoryWorldReadable
15180
15223
self.membership = membership
15181
15224
self.joinRule = joinRule
15225
+ self.isDirect = isDirect
15182
15226
}
15183
15227
}
15184
15228
@@ -15204,6 +15248,9 @@ extension RoomPreviewInfo: Equatable, Hashable {
15204
15248
if lhs.numJoinedMembers != rhs.numJoinedMembers {
15205
15249
return false
15206
15250
}
15251
+ if lhs.numActiveMembers != rhs.numActiveMembers {
15252
+ return false
15253
+ }
15207
15254
if lhs.roomType != rhs.roomType {
15208
15255
return false
15209
15256
}
@@ -15216,6 +15263,9 @@ extension RoomPreviewInfo: Equatable, Hashable {
15216
15263
if lhs.joinRule != rhs.joinRule {
15217
15264
return false
15218
15265
}
15266
+ if lhs.isDirect != rhs.isDirect {
15267
+ return false
15268
+ }
15219
15269
return true
15220
15270
}
15221
15271
@@ -15226,10 +15276,12 @@ extension RoomPreviewInfo: Equatable, Hashable {
15226
15276
hasher.combine(topic)
15227
15277
hasher.combine(avatarUrl)
15228
15278
hasher.combine(numJoinedMembers)
15279
+ hasher.combine(numActiveMembers)
15229
15280
hasher.combine(roomType)
15230
15281
hasher.combine(isHistoryWorldReadable)
15231
15282
hasher.combine(membership)
15232
15283
hasher.combine(joinRule)
15284
+ hasher.combine(isDirect)
15233
15285
}
15234
15286
}
15235
15287
@@ -15244,10 +15296,12 @@ public struct FfiConverterTypeRoomPreviewInfo: FfiConverterRustBuffer {
15244
15296
topic: FfiConverterOptionString.read(from: &buf),
15245
15297
avatarUrl: FfiConverterOptionString.read(from: &buf),
15246
15298
numJoinedMembers: FfiConverterUInt64.read(from: &buf),
15247
- roomType: FfiConverterOptionString.read(from: &buf),
15299
+ numActiveMembers: FfiConverterOptionUInt64.read(from: &buf),
15300
+ roomType: FfiConverterTypeRoomType.read(from: &buf),
15248
15301
isHistoryWorldReadable: FfiConverterBool.read(from: &buf),
15249
15302
membership: FfiConverterOptionTypeMembership.read(from: &buf),
15250
- joinRule: FfiConverterTypeJoinRule.read(from: &buf)
15303
+ joinRule: FfiConverterTypeJoinRule.read(from: &buf),
15304
+ isDirect: FfiConverterOptionBool.read(from: &buf)
15251
15305
)
15252
15306
}
15253
15307
@@ -15258,10 +15312,12 @@ public struct FfiConverterTypeRoomPreviewInfo: FfiConverterRustBuffer {
15258
15312
FfiConverterOptionString.write(value.topic, into: &buf)
15259
15313
FfiConverterOptionString.write(value.avatarUrl, into: &buf)
15260
15314
FfiConverterUInt64.write(value.numJoinedMembers, into: &buf)
15261
- FfiConverterOptionString.write(value.roomType, into: &buf)
15315
+ FfiConverterOptionUInt64.write(value.numActiveMembers, into: &buf)
15316
+ FfiConverterTypeRoomType.write(value.roomType, into: &buf)
15262
15317
FfiConverterBool.write(value.isHistoryWorldReadable, into: &buf)
15263
15318
FfiConverterOptionTypeMembership.write(value.membership, into: &buf)
15264
15319
FfiConverterTypeJoinRule.write(value.joinRule, into: &buf)
15320
+ FfiConverterOptionBool.write(value.isDirect, into: &buf)
15265
15321
}
15266
15322
}
15267
15323
@@ -22475,6 +22531,83 @@ extension RoomPreset: Equatable, Hashable {}
22475
22531
22476
22532
22477
22533
22534
+ // Note that we don't yet support `indirect` for enums.
22535
+ // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
22536
+ /**
22537
+ * The type of room for a [`RoomPreviewInfo`].
22538
+ */
22539
+
22540
+ public enum RoomType {
22541
+
22542
+ /**
22543
+ * It's a plain chat room.
22544
+ */
22545
+ case room
22546
+ /**
22547
+ * It's a space that can group several rooms.
22548
+ */
22549
+ case space
22550
+ /**
22551
+ * It's a custom implementation.
22552
+ */
22553
+ case custom(value: String
22554
+ )
22555
+ }
22556
+
22557
+
22558
+ public struct FfiConverterTypeRoomType: FfiConverterRustBuffer {
22559
+ typealias SwiftType = RoomType
22560
+
22561
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> RoomType {
22562
+ let variant: Int32 = try readInt(&buf)
22563
+ switch variant {
22564
+
22565
+ case 1: return .room
22566
+
22567
+ case 2: return .space
22568
+
22569
+ case 3: return .custom(value: try FfiConverterString.read(from: &buf)
22570
+ )
22571
+
22572
+ default: throw UniffiInternalError.unexpectedEnumCase
22573
+ }
22574
+ }
22575
+
22576
+ public static func write(_ value: RoomType, into buf: inout [UInt8]) {
22577
+ switch value {
22578
+
22579
+
22580
+ case .room:
22581
+ writeInt(&buf, Int32(1))
22582
+
22583
+
22584
+ case .space:
22585
+ writeInt(&buf, Int32(2))
22586
+
22587
+
22588
+ case let .custom(value):
22589
+ writeInt(&buf, Int32(3))
22590
+ FfiConverterString.write(value, into: &buf)
22591
+
22592
+ }
22593
+ }
22594
+ }
22595
+
22596
+
22597
+ public func FfiConverterTypeRoomType_lift(_ buf: RustBuffer) throws -> RoomType {
22598
+ return try FfiConverterTypeRoomType.lift(buf)
22599
+ }
22600
+
22601
+ public func FfiConverterTypeRoomType_lower(_ value: RoomType) -> RustBuffer {
22602
+ return FfiConverterTypeRoomType.lower(value)
22603
+ }
22604
+
22605
+
22606
+
22607
+ extension RoomType: Equatable, Hashable {}
22608
+
22609
+
22610
+
22478
22611
// Note that we don't yet support `indirect` for enums.
22479
22612
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
22480
22613
@@ -29518,6 +29651,9 @@ private var initializationResult: InitializationResult = {
29518
29651
if (uniffi_matrix_sdk_ffi_checksum_method_roompreview_info() != 9145) {
29519
29652
return InitializationResult.apiChecksumMismatch
29520
29653
}
29654
+ if (uniffi_matrix_sdk_ffi_checksum_method_roompreview_inviter() != 1297) {
29655
+ return InitializationResult.apiChecksumMismatch
29656
+ }
29521
29657
if (uniffi_matrix_sdk_ffi_checksum_method_roompreview_leave() != 5096) {
29522
29658
return InitializationResult.apiChecksumMismatch
29523
29659
}
@@ -29656,7 +29792,7 @@ private var initializationResult: InitializationResult = {
29656
29792
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_send_audio() != 43163) {
29657
29793
return InitializationResult.apiChecksumMismatch
29658
29794
}
29659
- if (uniffi_matrix_sdk_ffi_checksum_method_timeline_send_file() != 35408 ) {
29795
+ if (uniffi_matrix_sdk_ffi_checksum_method_timeline_send_file() != 37925 ) {
29660
29796
return InitializationResult.apiChecksumMismatch
29661
29797
}
29662
29798
if (uniffi_matrix_sdk_ffi_checksum_method_timeline_send_image() != 45681) {
0 commit comments