Skip to content

Commit feadfde

Browse files
robintownpoljar
authored andcommitted
feat(element-call): Support the sendNotificationType URL parameter
This URL parameter allows us to request Element Call widgets to send a notification when starting a call.
1 parent e2ad078 commit feadfde

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

crates/matrix-sdk/src/widget/settings/element_call.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ struct ElementCallParams {
7575
sentry_environment: Option<String>,
7676
hide_screensharing: bool,
7777
controlled_media_devices: bool,
78+
/// Supported since Element Call v0.14.0.
79+
send_notification_type: Option<NotificationType>,
7880
}
7981

8082
/// Defines if a call is encrypted and which encryption system should be used.
@@ -123,6 +125,16 @@ pub enum HeaderStyle {
123125
None,
124126
}
125127

128+
/// Types of call notifications.
129+
#[derive(Debug, PartialEq, Serialize, uniffi::Enum, Clone)]
130+
#[serde(rename_all = "snake_case")]
131+
pub enum NotificationType {
132+
/// The receiving client should display a visual notification.
133+
Notification,
134+
/// The receiving client should ring with an audible sound.
135+
Ring,
136+
}
137+
126138
/// Properties to create a new virtual Element Call widget.
127139
#[derive(Debug, Default, uniffi::Record, Clone)]
128140
pub struct VirtualElementCallWidgetOptions {
@@ -223,6 +235,9 @@ pub struct VirtualElementCallWidgetOptions {
223235
/// - `false`: the webview shows a a list of devices injected by the
224236
/// client. (used on ios & android)
225237
pub controlled_media_devices: bool,
238+
/// Whether and what type of notification Element Call should send, when
239+
/// starting a call.
240+
pub send_notification_type: Option<NotificationType>,
226241
}
227242

228243
impl WidgetSettings {
@@ -285,6 +300,7 @@ impl WidgetSettings {
285300
rageshake_submit_url: props.rageshake_submit_url,
286301
hide_screensharing: props.hide_screensharing,
287302
controlled_media_devices: props.controlled_media_devices,
303+
send_notification_type: props.send_notification_type,
288304
};
289305

290306
let query =

0 commit comments

Comments
 (0)