You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
Add managed hybrid call widgets when supported
If your homeserver is configured with an experiment `widget_build_url`, this will take over the functionality of the call buttons and turn them into a general widget installer.
This commit is contained in:
@@ -27,7 +27,7 @@ import {Room} from "matrix-js-sdk/src/models/room";
|
||||
import {WidgetType} from "../widgets/WidgetType";
|
||||
import {objectClone} from "./objects";
|
||||
import {_t} from "../languageHandler";
|
||||
import {Capability, IWidgetData, MatrixCapabilities} from "matrix-widget-api";
|
||||
import {Capability, IWidget, IWidgetData, MatrixCapabilities} from "matrix-widget-api";
|
||||
import {IApp} from "../stores/WidgetStore";
|
||||
|
||||
// How long we wait for the state event echo to come back from the server
|
||||
@@ -297,6 +297,16 @@ export default class WidgetUtils {
|
||||
content = {};
|
||||
}
|
||||
|
||||
return WidgetUtils.setRoomWidgetContent(roomId, widgetId, content);
|
||||
}
|
||||
|
||||
static setRoomWidgetContent(
|
||||
roomId: string,
|
||||
widgetId: string,
|
||||
content: IWidget,
|
||||
) {
|
||||
const addingWidget = !!content.url;
|
||||
|
||||
WidgetEchoStore.setRoomWidgetEcho(roomId, widgetId, content);
|
||||
|
||||
const client = MatrixClientPeg.get();
|
||||
|
||||
Reference in New Issue
Block a user