You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-10 09:22:25 +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:
@@ -16,10 +16,15 @@ limitations under the License.
|
||||
|
||||
import {MatrixClientPeg} from '../MatrixClientPeg';
|
||||
|
||||
const CALL_BEHAVIOUR_WK_KEY = "io.element.call_behaviour";
|
||||
const E2EE_WK_KEY = "io.element.e2ee";
|
||||
const E2EE_WK_KEY_DEPRECATED = "im.vector.riot.e2ee";
|
||||
|
||||
/* eslint-disable camelcase */
|
||||
export interface ICallBehaviourWellKnown {
|
||||
widget_build_url?: string;
|
||||
}
|
||||
|
||||
export interface IE2EEWellKnown {
|
||||
default?: boolean;
|
||||
secure_backup_required?: boolean;
|
||||
@@ -27,6 +32,11 @@ export interface IE2EEWellKnown {
|
||||
}
|
||||
/* eslint-enable camelcase */
|
||||
|
||||
export function getCallBehaviourWellKnown(): ICallBehaviourWellKnown {
|
||||
const clientWellKnown = MatrixClientPeg.get().getClientWellKnown();
|
||||
return clientWellKnown?.[CALL_BEHAVIOUR_WK_KEY];
|
||||
}
|
||||
|
||||
export function getE2EEWellKnown(): IE2EEWellKnown {
|
||||
const clientWellKnown = MatrixClientPeg.get().getClientWellKnown();
|
||||
if (clientWellKnown && clientWellKnown[E2EE_WK_KEY]) {
|
||||
|
||||
Reference in New Issue
Block a user