From 0ea737a34d83cfab21380bb10632e830d5feb27b Mon Sep 17 00:00:00 2001 From: Timo Date: Fri, 18 Jul 2025 12:15:41 +0200 Subject: [PATCH] add url param --- docs/url-params.md | 1 + src/UrlParams.ts | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/docs/url-params.md b/docs/url-params.md index bc3846cd..3e581f28 100644 --- a/docs/url-params.md +++ b/docs/url-params.md @@ -69,6 +69,7 @@ These parameters are relevant to both [widget](./embedded-standalone.md) and [st | `skipLobby` (deprecated: use `intent` instead) | `true` or `false` | No. If `intent` is explicitly `start_call` then defaults to `true`. Otherwise defaults to `false` | No, defaults to `false` | Skips the lobby to join a call directly, can be combined with preload in widget. When `true` the audio and video inputs will be muted by default. (This means there currently is no way to start without muted video if one wants to skip the lobby. Also not in widget mode.) | | `theme` | One of: `light`, `dark`, `light-high-contrast`, `dark-high-contrast` | No, defaults to `dark` | No, defaults to `dark` | UI theme to use. | | `viaServers` | Comma separated list of [Matrix Server Names](https://spec.matrix.org/v1.12/appendices/#server-name) | Not applicable | No | Homeserver for joining a room, non-empty value required for rooms not on the user’s default homeserver. | +| `sendNotification` | `true` or `false` | No | No | Will send an appropriate call notification event if the user is the first one in the call. | ### Widget-only parameters diff --git a/src/UrlParams.ts b/src/UrlParams.ts index 9f89fd47..1205df68 100644 --- a/src/UrlParams.ts +++ b/src/UrlParams.ts @@ -193,6 +193,14 @@ export interface UrlParams { * The Sentry environment. This is only used in the embedded package of Element Call. */ sentryEnvironment: string | null; + /** + * Whether to send a notification when the user joins the call. + * This does all the necessary logic to check if it is actually appropriate to send the notification, + * - is it the first joiner + * - it it a 1:1 room + * - ... + */ + sendNotification: boolean; } // This is here as a stopgap, but what would be far nicer is a function that @@ -329,6 +337,7 @@ export const getUrlParams = ( rageshakeSubmitUrl: parser.getParam("rageshakeSubmitUrl"), sentryDsn: parser.getParam("sentryDsn"), sentryEnvironment: parser.getParam("sentryEnvironment"), + sendNotification: parser.getFlagParam("sendNotification"), }; };