Convert cross-signing feature flag to setting

This is intended as a temporary measure until we're comfortable with removing the flag entirely.
This commit is contained in:
Travis Ralston 2020-04-15 13:18:42 -06:00
parent 2929bcf998
commit b4e2daaf46
24 changed files with 38 additions and 37 deletions

View file

@ -1506,7 +1506,7 @@ export default createReactClass({
});
cli.on("crypto.verification.request", request => {
const isFlagOn = SettingsStore.isFeatureEnabled("feature_cross_signing");
const isFlagOn = SettingsStore.getValue("feature_cross_signing");
if (!isFlagOn && !request.channel.deviceId) {
request.cancel({code: "m.invalid_message", reason: "This client has cross-signing disabled"});
@ -1556,7 +1556,7 @@ export default createReactClass({
// changing colour. More advanced behaviour will come once
// we implement more settings.
cli.setGlobalErrorOnUnknownDevices(
!SettingsStore.isFeatureEnabled("feature_cross_signing"),
!SettingsStore.getValue("feature_cross_signing"),
);
}
},
@ -1921,10 +1921,10 @@ export default createReactClass({
if (masterKeyInStorage) {
// Auto-enable cross-signing for the new session when key found in
// secret storage.
SettingsStore.setFeatureEnabled("feature_cross_signing", true);
SettingsStore.setValue("feature_cross_signing", null, SettingLevel.DEVICE, true);
this.setStateForNewView({ view: VIEWS.COMPLETE_SECURITY });
} else if (
SettingsStore.isFeatureEnabled("feature_cross_signing") &&
SettingsStore.getValue("feature_cross_signing") &&
await cli.doesServerSupportUnstableFeature("org.matrix.e2e_cross_signing")
) {
// This will only work if the feature is set to 'enable' in the config,