From feadfde1b54f2caf9d1dbbbd0208781b657b0c3f Mon Sep 17 00:00:00 2001 From: Robin Date: Sun, 27 Jul 2025 15:22:45 +0200 Subject: [PATCH] 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. --- .../src/widget/settings/element_call.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/crates/matrix-sdk/src/widget/settings/element_call.rs b/crates/matrix-sdk/src/widget/settings/element_call.rs index d1b5141c3..a2fa9ac76 100644 --- a/crates/matrix-sdk/src/widget/settings/element_call.rs +++ b/crates/matrix-sdk/src/widget/settings/element_call.rs @@ -75,6 +75,8 @@ struct ElementCallParams { sentry_environment: Option, hide_screensharing: bool, controlled_media_devices: bool, + /// Supported since Element Call v0.14.0. + send_notification_type: Option, } /// Defines if a call is encrypted and which encryption system should be used. @@ -123,6 +125,16 @@ pub enum HeaderStyle { None, } +/// Types of call notifications. +#[derive(Debug, PartialEq, Serialize, uniffi::Enum, Clone)] +#[serde(rename_all = "snake_case")] +pub enum NotificationType { + /// The receiving client should display a visual notification. + Notification, + /// The receiving client should ring with an audible sound. + Ring, +} + /// Properties to create a new virtual Element Call widget. #[derive(Debug, Default, uniffi::Record, Clone)] pub struct VirtualElementCallWidgetOptions { @@ -223,6 +235,9 @@ pub struct VirtualElementCallWidgetOptions { /// - `false`: the webview shows a a list of devices injected by the /// client. (used on ios & android) pub controlled_media_devices: bool, + /// Whether and what type of notification Element Call should send, when + /// starting a call. + pub send_notification_type: Option, } impl WidgetSettings { @@ -285,6 +300,7 @@ impl WidgetSettings { rageshake_submit_url: props.rageshake_submit_url, hide_screensharing: props.hide_screensharing, controlled_media_devices: props.controlled_media_devices, + send_notification_type: props.send_notification_type, }; let query =