@@ -891,6 +891,11 @@ public struct VirtualElementCallWidgetOptions {
891891 * client. (used on ios & android)
892892 */
893893 public var controlledMediaDevices : Bool
894+ /**
895+ * Whether and what type of notification Element Call should send, when
896+ * starting a call.
897+ */
898+ public var sendNotificationType : NotificationType ?
894899
895900 // Default memberwise initializers are never public by default, so we
896901 // declare one manually.
@@ -993,7 +998,11 @@ public struct VirtualElementCallWidgetOptions {
993998 /**
994999 * - `false`: the webview shows a a list of devices injected by the
9951000 * client. (used on ios & android)
996- */controlledMediaDevices: Bool ) {
1001+ */controlledMediaDevices: Bool ,
1002+ /**
1003+ * Whether and what type of notification Element Call should send, when
1004+ * starting a call.
1005+ */sendNotificationType: NotificationType ? ) {
9971006 self . elementCallUrl = elementCallUrl
9981007 self . widgetId = widgetId
9991008 self . parentUrl = parentUrl
@@ -1014,6 +1023,7 @@ public struct VirtualElementCallWidgetOptions {
10141023 self . sentryDsn = sentryDsn
10151024 self . sentryEnvironment = sentryEnvironment
10161025 self . controlledMediaDevices = controlledMediaDevices
1026+ self . sendNotificationType = sendNotificationType
10171027 }
10181028}
10191029
@@ -1081,6 +1091,9 @@ extension VirtualElementCallWidgetOptions: Equatable, Hashable {
10811091 if lhs. controlledMediaDevices != rhs. controlledMediaDevices {
10821092 return false
10831093 }
1094+ if lhs. sendNotificationType != rhs. sendNotificationType {
1095+ return false
1096+ }
10841097 return true
10851098 }
10861099
@@ -1105,6 +1118,7 @@ extension VirtualElementCallWidgetOptions: Equatable, Hashable {
11051118 hasher. combine ( sentryDsn)
11061119 hasher. combine ( sentryEnvironment)
11071120 hasher. combine ( controlledMediaDevices)
1121+ hasher. combine ( sendNotificationType)
11081122 }
11091123}
11101124
@@ -1132,7 +1146,8 @@ public struct FfiConverterTypeVirtualElementCallWidgetOptions: FfiConverterRustB
11321146 rageshakeSubmitUrl: FfiConverterOptionString . read ( from: & buf) ,
11331147 sentryDsn: FfiConverterOptionString . read ( from: & buf) ,
11341148 sentryEnvironment: FfiConverterOptionString . read ( from: & buf) ,
1135- controlledMediaDevices: FfiConverterBool . read ( from: & buf)
1149+ controlledMediaDevices: FfiConverterBool . read ( from: & buf) ,
1150+ sendNotificationType: FfiConverterOptionTypeNotificationType . read ( from: & buf)
11361151 )
11371152 }
11381153
@@ -1157,6 +1172,7 @@ public struct FfiConverterTypeVirtualElementCallWidgetOptions: FfiConverterRustB
11571172 FfiConverterOptionString . write ( value. sentryDsn, into: & buf)
11581173 FfiConverterOptionString . write ( value. sentryEnvironment, into: & buf)
11591174 FfiConverterBool . write ( value. controlledMediaDevices, into: & buf)
1175+ FfiConverterOptionTypeNotificationType . write ( value. sendNotificationType, into: & buf)
11601176 }
11611177}
11621178
@@ -1480,6 +1496,70 @@ extension Intent: Equatable, Hashable {}
14801496
14811497
14821498
1499+ // Note that we don't yet support `indirect` for enums.
1500+ // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
1501+ /**
1502+ * Types of call notifications.
1503+ */
1504+
1505+ public enum NotificationType {
1506+
1507+ /**
1508+ * The receiving client should display a visual notification.
1509+ */
1510+ case notification
1511+ /**
1512+ * The receiving client should ring with an audible sound.
1513+ */
1514+ case ring
1515+ }
1516+
1517+
1518+ public struct FfiConverterTypeNotificationType : FfiConverterRustBuffer {
1519+ typealias SwiftType = NotificationType
1520+
1521+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> NotificationType {
1522+ let variant : Int32 = try readInt ( & buf)
1523+ switch variant {
1524+
1525+ case 1 : return . notification
1526+
1527+ case 2 : return . ring
1528+
1529+ default : throw UniffiInternalError . unexpectedEnumCase
1530+ }
1531+ }
1532+
1533+ public static func write( _ value: NotificationType , into buf: inout [ UInt8 ] ) {
1534+ switch value {
1535+
1536+
1537+ case . notification:
1538+ writeInt ( & buf, Int32 ( 1 ) )
1539+
1540+
1541+ case . ring:
1542+ writeInt ( & buf, Int32 ( 2 ) )
1543+
1544+ }
1545+ }
1546+ }
1547+
1548+
1549+ public func FfiConverterTypeNotificationType_lift( _ buf: RustBuffer ) throws -> NotificationType {
1550+ return try FfiConverterTypeNotificationType . lift ( buf)
1551+ }
1552+
1553+ public func FfiConverterTypeNotificationType_lower( _ value: NotificationType ) -> RustBuffer {
1554+ return FfiConverterTypeNotificationType . lower ( value)
1555+ }
1556+
1557+
1558+
1559+ extension NotificationType : Equatable , Hashable { }
1560+
1561+
1562+
14831563// Note that we don't yet support `indirect` for enums.
14841564// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
14851565/**
@@ -1725,6 +1805,19 @@ extension QrCodeLoginError: Foundation.LocalizedError {
17251805
17261806public enum RoomMemberRole {
17271807
1808+ /**
1809+ * The member is a creator.
1810+ *
1811+ * A creator has an infinite power level and cannot be demoted, so this
1812+ * role is immutable. A room can have several creators.
1813+ *
1814+ * It is available in room versions where
1815+ * `explicitly_privilege_room_creators` in [`AuthorizationRules`] is set to
1816+ * `true`.
1817+ *
1818+ * [`AuthorizationRules`]: ruma::room_version_rules::AuthorizationRules
1819+ */
1820+ case creator
17281821 /**
17291822 * The member is an administrator.
17301823 */
@@ -1747,11 +1840,13 @@ public struct FfiConverterTypeRoomMemberRole: FfiConverterRustBuffer {
17471840 let variant : Int32 = try readInt ( & buf)
17481841 switch variant {
17491842
1750- case 1 : return . administrator
1843+ case 1 : return . creator
17511844
1752- case 2 : return . moderator
1845+ case 2 : return . administrator
17531846
1754- case 3 : return . user
1847+ case 3 : return . moderator
1848+
1849+ case 4 : return . user
17551850
17561851 default : throw UniffiInternalError . unexpectedEnumCase
17571852 }
@@ -1761,17 +1856,21 @@ public struct FfiConverterTypeRoomMemberRole: FfiConverterRustBuffer {
17611856 switch value {
17621857
17631858
1764- case . administrator :
1859+ case . creator :
17651860 writeInt ( & buf, Int32 ( 1 ) )
17661861
17671862
1768- case . moderator :
1863+ case . administrator :
17691864 writeInt ( & buf, Int32 ( 2 ) )
17701865
17711866
1772- case . user :
1867+ case . moderator :
17731868 writeInt ( & buf, Int32 ( 3 ) )
17741869
1870+
1871+ case . user:
1872+ writeInt ( & buf, Int32 ( 4 ) )
1873+
17751874 }
17761875 }
17771876}
@@ -1988,6 +2087,27 @@ fileprivate struct FfiConverterOptionTypeIntent: FfiConverterRustBuffer {
19882087 }
19892088}
19902089
2090+ fileprivate struct FfiConverterOptionTypeNotificationType : FfiConverterRustBuffer {
2091+ typealias SwiftType = NotificationType ?
2092+
2093+ public static func write( _ value: SwiftType , into buf: inout [ UInt8 ] ) {
2094+ guard let value = value else {
2095+ writeInt ( & buf, Int8 ( 0 ) )
2096+ return
2097+ }
2098+ writeInt ( & buf, Int8 ( 1 ) )
2099+ FfiConverterTypeNotificationType . write ( value, into: & buf)
2100+ }
2101+
2102+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> SwiftType {
2103+ switch try readInt ( & buf) as Int8 {
2104+ case 0 : return nil
2105+ case 1 : return try FfiConverterTypeNotificationType . read ( from: & buf)
2106+ default : throw UniffiInternalError . unexpectedOptionalTag
2107+ }
2108+ }
2109+ }
2110+
19912111private enum InitializationResult {
19922112 case ok
19932113 case contractVersionMismatch
0 commit comments