Invoke Secure Backup flow inside the app when requested by HS

If the Secure Backup required mode is set the client `.well-known` file, then
this will ensure that everyone already inside the app is required to complete
setup matching that policy.

Fixes https://github.com/vector-im/element-web/issues/14954
This commit is contained in:
J. Ryan Stinnett 2020-08-19 16:13:29 +01:00
parent e8e691b746
commit e56a61ec68
4 changed files with 42 additions and 2 deletions

View file

@ -23,6 +23,14 @@ export interface IE2EEWellKnown {
default?: boolean;
}
export async function ensureClientWellKnown() {
const cli = MatrixClientPeg.get();
if (cli.haveAttemptedFetchingClientWellKnown()) return;
return new Promise(resolve => {
cli.once("WellKnown.attempted", resolve);
});
}
export function getE2EEWellKnown(): IE2EEWellKnown {
const clientWellKnown = MatrixClientPeg.get().getClientWellKnown();
if (clientWellKnown && clientWellKnown[E2EE_WK_KEY]) {