From ab67a28c74db9fea79b8d03af39df95ec6fdb2d3 Mon Sep 17 00:00:00 2001 From: Bruno Windels <274386+bwindels@users.noreply.github.com> Date: Fri, 10 Feb 2023 17:35:45 +0100 Subject: [PATCH] add feature flag for cross-signing --- src/domain/session/settings/FeaturesViewModel.ts | 7 ++++++- src/features.ts | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/domain/session/settings/FeaturesViewModel.ts b/src/domain/session/settings/FeaturesViewModel.ts index 6017cc6a..552e27d4 100644 --- a/src/domain/session/settings/FeaturesViewModel.ts +++ b/src/domain/session/settings/FeaturesViewModel.ts @@ -29,7 +29,12 @@ export class FeaturesViewModel extends ViewModel { name: this.i18n`Audio/video calls`, description: this.i18n`Allows starting and participating in A/V calls compatible with Element Call (MSC3401). Look for the start call option in the room menu ((...) in the right corner) to start a call.`, feature: FeatureFlag.Calls - })), + })), + new FeatureViewModel(this.childOptions({ + name: this.i18n`Cross-Signing`, + description: this.i18n`Allows.verifying the identity of people you chat with`, + feature: FeatureFlag.CrossSigning + })), ]; } } diff --git a/src/features.ts b/src/features.ts index e503f0e0..6fa5dd43 100644 --- a/src/features.ts +++ b/src/features.ts @@ -18,6 +18,7 @@ import type {SettingsStorage} from "./platform/web/dom/SettingsStorage"; export enum FeatureFlag { Calls = 1 << 0, + CrossSigning = 1 << 1 } export class FeatureSet { @@ -39,6 +40,10 @@ export class FeatureSet { return this.isFeatureEnabled(FeatureFlag.Calls); } + get crossSigning(): boolean { + return this.isFeatureEnabled(FeatureFlag.CrossSigning); + } + static async load(settingsStorage: SettingsStorage): Promise { const flags = await settingsStorage.getInt("enabled_features") || 0; return new FeatureSet(flags);