@@ -5032,6 +5032,24 @@ public protocol RoomProtocol : AnyObject {
5032
5032
5033
5033
func membership() -> Membership
5034
5034
5035
+ /**
5036
+ * A timeline instance that can be configured to only include RoomMessage
5037
+ * type events and filter those further based on their message type.
5038
+ *
5039
+ * Virtual timeline items will still be provided and the
5040
+ * `default_event_filter` will be applied before everything else.
5041
+ *
5042
+ * # Arguments
5043
+ *
5044
+ * * `internal_id_prefix` - An optional String that will be prepended to
5045
+ * all the timeline item's internal IDs, making it possible to
5046
+ * distinguish different timeline instances from each other.
5047
+ *
5048
+ * * `allowed_message_types` - A list of `RoomMessageEventMessageType` that
5049
+ * will be allowed to appear in the timeline
5050
+ */
5051
+ func messageFilteredTimeline(internalIdPrefix: String?, allowedMessageTypes: [RoomMessageEventMessageType]) async throws -> Timeline
5052
+
5035
5053
func ownUserId() -> String
5036
5054
5037
5055
func pinnedEventsTimeline(internalIdPrefix: String?, maxEventsToLoad: UInt16, maxConcurrentRequests: UInt16) async throws -> Timeline
@@ -5980,6 +5998,39 @@ open func membership() -> Membership {
5980
5998
})
5981
5999
}
5982
6000
6001
+ /**
6002
+ * A timeline instance that can be configured to only include RoomMessage
6003
+ * type events and filter those further based on their message type.
6004
+ *
6005
+ * Virtual timeline items will still be provided and the
6006
+ * `default_event_filter` will be applied before everything else.
6007
+ *
6008
+ * # Arguments
6009
+ *
6010
+ * * `internal_id_prefix` - An optional String that will be prepended to
6011
+ * all the timeline item's internal IDs, making it possible to
6012
+ * distinguish different timeline instances from each other.
6013
+ *
6014
+ * * `allowed_message_types` - A list of `RoomMessageEventMessageType` that
6015
+ * will be allowed to appear in the timeline
6016
+ */
6017
+ open func messageFilteredTimeline(internalIdPrefix: String?, allowedMessageTypes: [RoomMessageEventMessageType])async throws -> Timeline {
6018
+ return
6019
+ try await uniffiRustCallAsync(
6020
+ rustFutureFunc: {
6021
+ uniffi_matrix_sdk_ffi_fn_method_room_message_filtered_timeline(
6022
+ self.uniffiClonePointer(),
6023
+ FfiConverterOptionString.lower(internalIdPrefix),FfiConverterSequenceTypeRoomMessageEventMessageType.lower(allowedMessageTypes)
6024
+ )
6025
+ },
6026
+ pollFunc: ffi_matrix_sdk_ffi_rust_future_poll_pointer,
6027
+ completeFunc: ffi_matrix_sdk_ffi_rust_future_complete_pointer,
6028
+ freeFunc: ffi_matrix_sdk_ffi_rust_future_free_pointer,
6029
+ liftFunc: FfiConverterTypeTimeline.lift,
6030
+ errorHandler: FfiConverterTypeClientError.lift
6031
+ )
6032
+ }
6033
+
5983
6034
open func ownUserId() -> String {
5984
6035
return try! FfiConverterString.lift(try! rustCall() {
5985
6036
uniffi_matrix_sdk_ffi_fn_method_room_own_user_id(self.uniffiClonePointer(),$0
@@ -22444,6 +22495,124 @@ extension RoomListServiceSyncIndicator: Equatable, Hashable {}
22444
22495
22445
22496
22446
22497
22498
+ // Note that we don't yet support `indirect` for enums.
22499
+ // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
22500
+
22501
+ public enum RoomMessageEventMessageType {
22502
+
22503
+ case audio
22504
+ case emote
22505
+ case file
22506
+ case image
22507
+ case location
22508
+ case notice
22509
+ case serverNotice
22510
+ case text
22511
+ case video
22512
+ case verificationRequest
22513
+ case other
22514
+ }
22515
+
22516
+
22517
+ public struct FfiConverterTypeRoomMessageEventMessageType: FfiConverterRustBuffer {
22518
+ typealias SwiftType = RoomMessageEventMessageType
22519
+
22520
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> RoomMessageEventMessageType {
22521
+ let variant: Int32 = try readInt(&buf)
22522
+ switch variant {
22523
+
22524
+ case 1: return .audio
22525
+
22526
+ case 2: return .emote
22527
+
22528
+ case 3: return .file
22529
+
22530
+ case 4: return .image
22531
+
22532
+ case 5: return .location
22533
+
22534
+ case 6: return .notice
22535
+
22536
+ case 7: return .serverNotice
22537
+
22538
+ case 8: return .text
22539
+
22540
+ case 9: return .video
22541
+
22542
+ case 10: return .verificationRequest
22543
+
22544
+ case 11: return .other
22545
+
22546
+ default: throw UniffiInternalError.unexpectedEnumCase
22547
+ }
22548
+ }
22549
+
22550
+ public static func write(_ value: RoomMessageEventMessageType, into buf: inout [UInt8]) {
22551
+ switch value {
22552
+
22553
+
22554
+ case .audio:
22555
+ writeInt(&buf, Int32(1))
22556
+
22557
+
22558
+ case .emote:
22559
+ writeInt(&buf, Int32(2))
22560
+
22561
+
22562
+ case .file:
22563
+ writeInt(&buf, Int32(3))
22564
+
22565
+
22566
+ case .image:
22567
+ writeInt(&buf, Int32(4))
22568
+
22569
+
22570
+ case .location:
22571
+ writeInt(&buf, Int32(5))
22572
+
22573
+
22574
+ case .notice:
22575
+ writeInt(&buf, Int32(6))
22576
+
22577
+
22578
+ case .serverNotice:
22579
+ writeInt(&buf, Int32(7))
22580
+
22581
+
22582
+ case .text:
22583
+ writeInt(&buf, Int32(8))
22584
+
22585
+
22586
+ case .video:
22587
+ writeInt(&buf, Int32(9))
22588
+
22589
+
22590
+ case .verificationRequest:
22591
+ writeInt(&buf, Int32(10))
22592
+
22593
+
22594
+ case .other:
22595
+ writeInt(&buf, Int32(11))
22596
+
22597
+ }
22598
+ }
22599
+ }
22600
+
22601
+
22602
+ public func FfiConverterTypeRoomMessageEventMessageType_lift(_ buf: RustBuffer) throws -> RoomMessageEventMessageType {
22603
+ return try FfiConverterTypeRoomMessageEventMessageType.lift(buf)
22604
+ }
22605
+
22606
+ public func FfiConverterTypeRoomMessageEventMessageType_lower(_ value: RoomMessageEventMessageType) -> RustBuffer {
22607
+ return FfiConverterTypeRoomMessageEventMessageType.lower(value)
22608
+ }
22609
+
22610
+
22611
+
22612
+ extension RoomMessageEventMessageType: Equatable, Hashable {}
22613
+
22614
+
22615
+
22447
22616
// Note that we don't yet support `indirect` for enums.
22448
22617
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
22449
22618
/**
@@ -28380,6 +28549,28 @@ fileprivate struct FfiConverterSequenceTypeRoomListEntriesUpdate: FfiConverterRu
28380
28549
}
28381
28550
}
28382
28551
28552
+ fileprivate struct FfiConverterSequenceTypeRoomMessageEventMessageType: FfiConverterRustBuffer {
28553
+ typealias SwiftType = [RoomMessageEventMessageType]
28554
+
28555
+ public static func write(_ value: [RoomMessageEventMessageType], into buf: inout [UInt8]) {
28556
+ let len = Int32(value.count)
28557
+ writeInt(&buf, len)
28558
+ for item in value {
28559
+ FfiConverterTypeRoomMessageEventMessageType.write(item, into: &buf)
28560
+ }
28561
+ }
28562
+
28563
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [RoomMessageEventMessageType] {
28564
+ let len: Int32 = try readInt(&buf)
28565
+ var seq = [RoomMessageEventMessageType]()
28566
+ seq.reserveCapacity(Int(len))
28567
+ for _ in 0 ..< len {
28568
+ seq.append(try FfiConverterTypeRoomMessageEventMessageType.read(from: &buf))
28569
+ }
28570
+ return seq
28571
+ }
28572
+ }
28573
+
28383
28574
fileprivate struct FfiConverterSequenceTypeSlidingSyncVersion: FfiConverterRustBuffer {
28384
28575
typealias SwiftType = [SlidingSyncVersion]
28385
28576
@@ -29551,6 +29742,9 @@ private var initializationResult: InitializationResult = {
29551
29742
if (uniffi_matrix_sdk_ffi_checksum_method_room_membership() != 26065) {
29552
29743
return InitializationResult.apiChecksumMismatch
29553
29744
}
29745
+ if (uniffi_matrix_sdk_ffi_checksum_method_room_message_filtered_timeline() != 47862) {
29746
+ return InitializationResult.apiChecksumMismatch
29747
+ }
29554
29748
if (uniffi_matrix_sdk_ffi_checksum_method_room_own_user_id() != 39510) {
29555
29749
return InitializationResult.apiChecksumMismatch
29556
29750
}
0 commit comments