1
0
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:
J. Ryan Stinnett
2021-01-29 14:26:33 +00:00
parent 241955f7c2
commit 2c313e0c5e
5 changed files with 131 additions and 2 deletions

View File

@@ -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]) {