From 18b771e620fceba9a296c4d8ee9d9a61dccd2027 Mon Sep 17 00:00:00 2001 From: Timo K Date: Tue, 3 Feb 2026 11:10:57 +0100 Subject: [PATCH] Allow sending room events in rtc sdk --- sdk/main.ts | 2 +- src/widget.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sdk/main.ts b/sdk/main.ts index 5625ba0d..fddba53c 100644 --- a/sdk/main.ts +++ b/sdk/main.ts @@ -99,7 +99,7 @@ export async function createMatrixRTCSdk( const scope = new ObservableScope(); // widget client - initializeWidget(application); + initializeWidget(application, true); const widget = _widget; if (!widget) throw Error("No widget. This webapp can only start as a widget"); const client = await widget.client; diff --git a/src/widget.ts b/src/widget.ts index a526b8dd..e04fd794 100644 --- a/src/widget.ts +++ b/src/widget.ts @@ -68,7 +68,10 @@ export let widget: WidgetHelpers | null; */ // this needs to be a seperate call and cannot be done on import to allow us to spy on methods in here before // execution. -export const initializeWidget = (rtcApplication: string = "m.call"): void => { +export const initializeWidget = ( + rtcApplication: string = "m.call", + sendRoomEvents = false, +): void => { try { const { widgetId, @@ -116,6 +119,9 @@ export const initializeWidget = (rtcApplication: string = "m.call"): void => { EventType.CallNotify, // Sent as a deprecated fallback EventType.RTCNotification, ]; + if (sendRoomEvents) { + sendEvent.push(EventType.RoomMessage); + } const sendRecvEvent = [ "org.matrix.rageshake_request", EventType.CallEncryptionKeysPrefix,