Allow sending room events in rtc sdk
This commit is contained in:
@@ -99,7 +99,7 @@ export async function createMatrixRTCSdk(
|
|||||||
const scope = new ObservableScope();
|
const scope = new ObservableScope();
|
||||||
|
|
||||||
// widget client
|
// widget client
|
||||||
initializeWidget(application);
|
initializeWidget(application, true);
|
||||||
const widget = _widget;
|
const widget = _widget;
|
||||||
if (!widget) throw Error("No widget. This webapp can only start as a widget");
|
if (!widget) throw Error("No widget. This webapp can only start as a widget");
|
||||||
const client = await widget.client;
|
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
|
// this needs to be a seperate call and cannot be done on import to allow us to spy on methods in here before
|
||||||
// execution.
|
// execution.
|
||||||
export const initializeWidget = (rtcApplication: string = "m.call"): void => {
|
export const initializeWidget = (
|
||||||
|
rtcApplication: string = "m.call",
|
||||||
|
sendRoomEvents = false,
|
||||||
|
): void => {
|
||||||
try {
|
try {
|
||||||
const {
|
const {
|
||||||
widgetId,
|
widgetId,
|
||||||
@@ -116,6 +119,9 @@ export const initializeWidget = (rtcApplication: string = "m.call"): void => {
|
|||||||
EventType.CallNotify, // Sent as a deprecated fallback
|
EventType.CallNotify, // Sent as a deprecated fallback
|
||||||
EventType.RTCNotification,
|
EventType.RTCNotification,
|
||||||
];
|
];
|
||||||
|
if (sendRoomEvents) {
|
||||||
|
sendEvent.push(EventType.RoomMessage);
|
||||||
|
}
|
||||||
const sendRecvEvent = [
|
const sendRecvEvent = [
|
||||||
"org.matrix.rageshake_request",
|
"org.matrix.rageshake_request",
|
||||||
EventType.CallEncryptionKeysPrefix,
|
EventType.CallEncryptionKeysPrefix,
|
||||||
|
|||||||
Reference in New Issue
Block a user