@@ -2610,6 +2610,7 @@ public protocol RoomProtocol {
26102610 func createPoll(question: String, answers: [String], maxSelections: UInt8, pollKind: PollKind, txnId: String?) throws
26112611 func displayName() throws -> String
26122612 func edit(newMsg: RoomMessageEventContentWithoutRelation, originalEventId: String, txnId: String?) throws
2613+ func endPoll(pollStartId: String, text: String, txnId: String?) throws
26132614 func fetchDetailsForEvent(eventId: String) throws
26142615 func fetchMembers() throws -> TaskHandle
26152616 func getTimelineEventContentByEventId(eventId: String) throws -> RoomMessageEventContentWithoutRelation
@@ -2646,6 +2647,7 @@ public protocol RoomProtocol {
26462647 func sendFile(url: String, fileInfo: FileInfo, progressWatcher: ProgressWatcher?) -> SendAttachmentJoinHandle
26472648 func sendImage(url: String, thumbnailUrl: String, imageInfo: ImageInfo, progressWatcher: ProgressWatcher?) -> SendAttachmentJoinHandle
26482649 func sendLocation(body: String, geoUri: String, description: String?, zoomLevel: UInt8?, assetType: AssetType?, txnId: String?)
2650+ func sendPollResponse(pollStartId: String, answers: [String], txnId: String?) throws
26492651 func sendReadMarker(fullyReadEventId: String, readReceiptEventId: String?) throws
26502652 func sendReadReceipt(eventId: String) throws
26512653 func sendReply(msg: RoomMessageEventContentWithoutRelation, inReplyToEventId: String, txnId: String?) throws
@@ -2969,6 +2971,17 @@ public class Room: RoomProtocol {
29692971}
29702972 }
29712973
2974+ public func endPoll(pollStartId: String, text: String, txnId: String?) throws {
2975+ try
2976+ rustCallWithError(FfiConverterTypeClientError.lift) {
2977+ uniffi_matrix_sdk_ffi_fn_method_room_end_poll(self.pointer,
2978+ FfiConverterString.lower(pollStartId),
2979+ FfiConverterString.lower(text),
2980+ FfiConverterOptionString.lower(txnId),$0
2981+ )
2982+ }
2983+ }
2984+
29722985 public func fetchDetailsForEvent(eventId: String) throws {
29732986 try
29742987 rustCallWithError(FfiConverterTypeClientError.lift) {
@@ -3368,6 +3381,17 @@ public class Room: RoomProtocol {
33683381}
33693382 }
33703383
3384+ public func sendPollResponse(pollStartId: String, answers: [String], txnId: String?) throws {
3385+ try
3386+ rustCallWithError(FfiConverterTypeClientError.lift) {
3387+ uniffi_matrix_sdk_ffi_fn_method_room_send_poll_response(self.pointer,
3388+ FfiConverterString.lower(pollStartId),
3389+ FfiConverterSequenceString.lower(answers),
3390+ FfiConverterOptionString.lower(txnId),$0
3391+ )
3392+ }
3393+ }
3394+
33713395 public func sendReadMarker(fullyReadEventId: String, readReceiptEventId: String?) throws {
33723396 try
33733397 rustCallWithError(FfiConverterTypeClientError.lift) {
@@ -8626,13 +8650,13 @@ public func FfiConverterTypeVideoMessageContent_lower(_ value: VideoMessageConte
86268650
86278651
86288652public struct Widget {
8629- public var info: WidgetInfo
8653+ public var settings: WidgetSettings
86308654 public var comm: WidgetComm
86318655
86328656 // Default memberwise initializers are never public by default, so we
86338657 // declare one manually.
8634- public init(info: WidgetInfo , comm: WidgetComm) {
8635- self.info = info
8658+ public init(settings: WidgetSettings , comm: WidgetComm) {
8659+ self.settings = settings
86368660 self.comm = comm
86378661 }
86388662}
@@ -8642,13 +8666,13 @@ public struct Widget {
86428666public struct FfiConverterTypeWidget: FfiConverterRustBuffer {
86438667 public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Widget {
86448668 return try Widget(
8645- info: FfiConverterTypeWidgetInfo .read(from: &buf),
8669+ settings: FfiConverterTypeWidgetSettings .read(from: &buf),
86468670 comm: FfiConverterTypeWidgetComm.read(from: &buf)
86478671 )
86488672 }
86498673
86508674 public static func write(_ value: Widget, into buf: inout [UInt8]) {
8651- FfiConverterTypeWidgetInfo .write(value.info , into: &buf)
8675+ FfiConverterTypeWidgetSettings .write(value.settings , into: &buf)
86528676 FfiConverterTypeWidgetComm.write(value.comm, into: &buf)
86538677 }
86548678}
@@ -8663,113 +8687,113 @@ public func FfiConverterTypeWidget_lower(_ value: Widget) -> RustBuffer {
86638687}
86648688
86658689
8666- public struct WidgetInfo {
8667- public var id: String
8668- public var initOnLoad: Bool
8690+ public struct WidgetPermissions {
8691+ public var read: [WidgetEventFilter]
8692+ public var send: [WidgetEventFilter]
86698693
86708694 // Default memberwise initializers are never public by default, so we
86718695 // declare one manually.
8672- public init(id: String, initOnLoad: Bool ) {
8673- self.id = id
8674- self.initOnLoad = initOnLoad
8696+ public init(read: [WidgetEventFilter], send: [WidgetEventFilter] ) {
8697+ self.read = read
8698+ self.send = send
86758699 }
86768700}
86778701
86788702
8679- extension WidgetInfo : Equatable, Hashable {
8680- public static func ==(lhs: WidgetInfo , rhs: WidgetInfo ) -> Bool {
8681- if lhs.id != rhs.id {
8703+ extension WidgetPermissions : Equatable, Hashable {
8704+ public static func ==(lhs: WidgetPermissions , rhs: WidgetPermissions ) -> Bool {
8705+ if lhs.read != rhs.read {
86828706 return false
86838707 }
8684- if lhs.initOnLoad != rhs.initOnLoad {
8708+ if lhs.send != rhs.send {
86858709 return false
86868710 }
86878711 return true
86888712 }
86898713
86908714 public func hash(into hasher: inout Hasher) {
8691- hasher.combine(id )
8692- hasher.combine(initOnLoad )
8715+ hasher.combine(read )
8716+ hasher.combine(send )
86938717 }
86948718}
86958719
86968720
8697- public struct FfiConverterTypeWidgetInfo : FfiConverterRustBuffer {
8698- public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WidgetInfo {
8699- return try WidgetInfo (
8700- id: FfiConverterString .read(from: &buf),
8701- initOnLoad: FfiConverterBool .read(from: &buf)
8721+ public struct FfiConverterTypeWidgetPermissions : FfiConverterRustBuffer {
8722+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WidgetPermissions {
8723+ return try WidgetPermissions (
8724+ read: FfiConverterSequenceTypeWidgetEventFilter .read(from: &buf),
8725+ send: FfiConverterSequenceTypeWidgetEventFilter .read(from: &buf)
87028726 )
87038727 }
87048728
8705- public static func write(_ value: WidgetInfo , into buf: inout [UInt8]) {
8706- FfiConverterString .write(value.id , into: &buf)
8707- FfiConverterBool .write(value.initOnLoad , into: &buf)
8729+ public static func write(_ value: WidgetPermissions , into buf: inout [UInt8]) {
8730+ FfiConverterSequenceTypeWidgetEventFilter .write(value.read , into: &buf)
8731+ FfiConverterSequenceTypeWidgetEventFilter .write(value.send , into: &buf)
87088732 }
87098733}
87108734
87118735
8712- public func FfiConverterTypeWidgetInfo_lift (_ buf: RustBuffer) throws -> WidgetInfo {
8713- return try FfiConverterTypeWidgetInfo .lift(buf)
8736+ public func FfiConverterTypeWidgetPermissions_lift (_ buf: RustBuffer) throws -> WidgetPermissions {
8737+ return try FfiConverterTypeWidgetPermissions .lift(buf)
87148738}
87158739
8716- public func FfiConverterTypeWidgetInfo_lower (_ value: WidgetInfo ) -> RustBuffer {
8717- return FfiConverterTypeWidgetInfo .lower(value)
8740+ public func FfiConverterTypeWidgetPermissions_lower (_ value: WidgetPermissions ) -> RustBuffer {
8741+ return FfiConverterTypeWidgetPermissions .lower(value)
87188742}
87198743
87208744
8721- public struct WidgetPermissions {
8722- public var read: [WidgetEventFilter]
8723- public var send: [WidgetEventFilter]
8745+ public struct WidgetSettings {
8746+ public var id: String
8747+ public var initOnLoad: Bool
87248748
87258749 // Default memberwise initializers are never public by default, so we
87268750 // declare one manually.
8727- public init(read: [WidgetEventFilter], send: [WidgetEventFilter] ) {
8728- self.read = read
8729- self.send = send
8751+ public init(id: String, initOnLoad: Bool ) {
8752+ self.id = id
8753+ self.initOnLoad = initOnLoad
87308754 }
87318755}
87328756
87338757
8734- extension WidgetPermissions : Equatable, Hashable {
8735- public static func ==(lhs: WidgetPermissions , rhs: WidgetPermissions ) -> Bool {
8736- if lhs.read != rhs.read {
8758+ extension WidgetSettings : Equatable, Hashable {
8759+ public static func ==(lhs: WidgetSettings , rhs: WidgetSettings ) -> Bool {
8760+ if lhs.id != rhs.id {
87378761 return false
87388762 }
8739- if lhs.send != rhs.send {
8763+ if lhs.initOnLoad != rhs.initOnLoad {
87408764 return false
87418765 }
87428766 return true
87438767 }
87448768
87458769 public func hash(into hasher: inout Hasher) {
8746- hasher.combine(read )
8747- hasher.combine(send )
8770+ hasher.combine(id )
8771+ hasher.combine(initOnLoad )
87488772 }
87498773}
87508774
87518775
8752- public struct FfiConverterTypeWidgetPermissions : FfiConverterRustBuffer {
8753- public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WidgetPermissions {
8754- return try WidgetPermissions (
8755- read: FfiConverterSequenceTypeWidgetEventFilter .read(from: &buf),
8756- send: FfiConverterSequenceTypeWidgetEventFilter .read(from: &buf)
8776+ public struct FfiConverterTypeWidgetSettings : FfiConverterRustBuffer {
8777+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WidgetSettings {
8778+ return try WidgetSettings (
8779+ id: FfiConverterString .read(from: &buf),
8780+ initOnLoad: FfiConverterBool .read(from: &buf)
87578781 )
87588782 }
87598783
8760- public static func write(_ value: WidgetPermissions , into buf: inout [UInt8]) {
8761- FfiConverterSequenceTypeWidgetEventFilter .write(value.read , into: &buf)
8762- FfiConverterSequenceTypeWidgetEventFilter .write(value.send , into: &buf)
8784+ public static func write(_ value: WidgetSettings , into buf: inout [UInt8]) {
8785+ FfiConverterString .write(value.id , into: &buf)
8786+ FfiConverterBool .write(value.initOnLoad , into: &buf)
87638787 }
87648788}
87658789
87668790
8767- public func FfiConverterTypeWidgetPermissions_lift (_ buf: RustBuffer) throws -> WidgetPermissions {
8768- return try FfiConverterTypeWidgetPermissions .lift(buf)
8791+ public func FfiConverterTypeWidgetSettings_lift (_ buf: RustBuffer) throws -> WidgetSettings {
8792+ return try FfiConverterTypeWidgetSettings .lift(buf)
87698793}
87708794
8771- public func FfiConverterTypeWidgetPermissions_lower (_ value: WidgetPermissions ) -> RustBuffer {
8772- return FfiConverterTypeWidgetPermissions .lower(value)
8795+ public func FfiConverterTypeWidgetSettings_lower (_ value: WidgetSettings ) -> RustBuffer {
8796+ return FfiConverterTypeWidgetSettings .lower(value)
87738797}
87748798
87758799// Note that we don't yet support `indirect` for enums.
@@ -12526,8 +12550,10 @@ extension VirtualTimelineItem: Equatable, Hashable {}
1252612550// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
1252712551public enum WidgetEventFilter {
1252812552
12529- case messageLike(eventType: String, msgtype: String?)
12530- case state(eventType: String, stateKey: String?)
12553+ case messageLikeWithType(eventType: String)
12554+ case roomMessageWithMsgtype(msgtype: String)
12555+ case stateWithType(eventType: String)
12556+ case stateWithTypeAndStateKey(eventType: String, stateKey: String)
1253112557}
1253212558
1253312559public struct FfiConverterTypeWidgetEventFilter: FfiConverterRustBuffer {
@@ -12537,14 +12563,21 @@ public struct FfiConverterTypeWidgetEventFilter: FfiConverterRustBuffer {
1253712563 let variant: Int32 = try readInt(&buf)
1253812564 switch variant {
1253912565
12540- case 1: return .messageLike(
12541- eventType: try FfiConverterString.read(from: &buf),
12542- msgtype: try FfiConverterOptionString.read(from: &buf)
12566+ case 1: return .messageLikeWithType(
12567+ eventType: try FfiConverterString.read(from: &buf)
1254312568 )
1254412569
12545- case 2: return .state(
12570+ case 2: return .roomMessageWithMsgtype(
12571+ msgtype: try FfiConverterString.read(from: &buf)
12572+ )
12573+
12574+ case 3: return .stateWithType(
12575+ eventType: try FfiConverterString.read(from: &buf)
12576+ )
12577+
12578+ case 4: return .stateWithTypeAndStateKey(
1254612579 eventType: try FfiConverterString.read(from: &buf),
12547- stateKey: try FfiConverterOptionString .read(from: &buf)
12580+ stateKey: try FfiConverterString .read(from: &buf)
1254812581 )
1254912582
1255012583 default: throw UniffiInternalError.unexpectedEnumCase
@@ -12555,16 +12588,25 @@ public struct FfiConverterTypeWidgetEventFilter: FfiConverterRustBuffer {
1255512588 switch value {
1255612589
1255712590
12558- case let .messageLike (eventType,msgtype ):
12591+ case let .messageLikeWithType (eventType):
1255912592 writeInt(&buf, Int32(1))
1256012593 FfiConverterString.write(eventType, into: &buf)
12561- FfiConverterOptionString.write(msgtype, into: &buf)
1256212594
1256312595
12564- case let .state(eventType,stateKey ):
12596+ case let .roomMessageWithMsgtype(msgtype ):
1256512597 writeInt(&buf, Int32(2))
12598+ FfiConverterString.write(msgtype, into: &buf)
12599+
12600+
12601+ case let .stateWithType(eventType):
12602+ writeInt(&buf, Int32(3))
1256612603 FfiConverterString.write(eventType, into: &buf)
12567- FfiConverterOptionString.write(stateKey, into: &buf)
12604+
12605+
12606+ case let .stateWithTypeAndStateKey(eventType,stateKey):
12607+ writeInt(&buf, Int32(4))
12608+ FfiConverterString.write(eventType, into: &buf)
12609+ FfiConverterString.write(stateKey, into: &buf)
1256812610
1256912611 }
1257012612 }
@@ -17295,6 +17337,9 @@ private var initializationResult: InitializationResult {
1729517337 if (uniffi_matrix_sdk_ffi_checksum_method_room_edit() != 35232) {
1729617338 return InitializationResult.apiChecksumMismatch
1729717339 }
17340+ if (uniffi_matrix_sdk_ffi_checksum_method_room_end_poll() != 8937) {
17341+ return InitializationResult.apiChecksumMismatch
17342+ }
1729817343 if (uniffi_matrix_sdk_ffi_checksum_method_room_fetch_details_for_event() != 23233) {
1729917344 return InitializationResult.apiChecksumMismatch
1730017345 }
@@ -17403,6 +17448,9 @@ private var initializationResult: InitializationResult {
1740317448 if (uniffi_matrix_sdk_ffi_checksum_method_room_send_location() != 43614) {
1740417449 return InitializationResult.apiChecksumMismatch
1740517450 }
17451+ if (uniffi_matrix_sdk_ffi_checksum_method_room_send_poll_response() != 1386) {
17452+ return InitializationResult.apiChecksumMismatch
17453+ }
1740617454 if (uniffi_matrix_sdk_ffi_checksum_method_room_send_read_marker() != 53306) {
1740717455 return InitializationResult.apiChecksumMismatch
1740817456 }
0 commit comments