mirror of
https://github.com/vector-im/element-call.git
synced 2026-02-08 04:19:11 +00:00
Allow sending room events in rtc sdk
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user