mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
add feature flag for cross-signing
This commit is contained in:
parent
551a9e0bc8
commit
ab67a28c74
@ -30,6 +30,11 @@ export class FeaturesViewModel extends ViewModel {
|
|||||||
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.`,
|
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
|
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
|
||||||
|
})),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ import type {SettingsStorage} from "./platform/web/dom/SettingsStorage";
|
|||||||
|
|
||||||
export enum FeatureFlag {
|
export enum FeatureFlag {
|
||||||
Calls = 1 << 0,
|
Calls = 1 << 0,
|
||||||
|
CrossSigning = 1 << 1
|
||||||
}
|
}
|
||||||
|
|
||||||
export class FeatureSet {
|
export class FeatureSet {
|
||||||
@ -39,6 +40,10 @@ export class FeatureSet {
|
|||||||
return this.isFeatureEnabled(FeatureFlag.Calls);
|
return this.isFeatureEnabled(FeatureFlag.Calls);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get crossSigning(): boolean {
|
||||||
|
return this.isFeatureEnabled(FeatureFlag.CrossSigning);
|
||||||
|
}
|
||||||
|
|
||||||
static async load(settingsStorage: SettingsStorage): Promise<FeatureSet> {
|
static async load(settingsStorage: SettingsStorage): Promise<FeatureSet> {
|
||||||
const flags = await settingsStorage.getInt("enabled_features") || 0;
|
const flags = await settingsStorage.getInt("enabled_features") || 0;
|
||||||
return new FeatureSet(flags);
|
return new FeatureSet(flags);
|
||||||
|
Loading…
Reference in New Issue
Block a user