EventIndex: Hide the feature behind a labs flag.

This commit is contained in:
Damir Jelić 2019-11-19 12:23:49 +01:00
parent 979803797f
commit f776bdcc8b
3 changed files with 13 additions and 1 deletions

View File

@ -21,6 +21,7 @@ limitations under the License.
import PlatformPeg from "./PlatformPeg";
import EventIndex from "./EventIndex";
import SettingsStore from './settings/SettingsStore';
class EventIndexPeg {
constructor() {
@ -34,6 +35,10 @@ class EventIndexPeg {
* EventIndex was successfully initialized, false otherwise.
*/
async init() {
if (!SettingsStore.isFeatureEnabled("feature_event_indexing")) {
return false;
}
const indexManager = PlatformPeg.get().getEventIndexingManager();
if (!indexManager || await indexManager.supportsEventIndexing() !== true) {
console.log("EventIndex: Platform doesn't support event indexing,",

View File

@ -1829,5 +1829,6 @@
"If you didn't remove the recovery method, an attacker may be trying to access your account. Change your account password and set a new recovery method immediately in Settings.": "If you didn't remove the recovery method, an attacker may be trying to access your account. Change your account password and set a new recovery method immediately in Settings.",
"Failed to set direct chat tag": "Failed to set direct chat tag",
"Failed to remove tag %(tagName)s from room": "Failed to remove tag %(tagName)s from room",
"Failed to add tag %(tagName)s to room": "Failed to add tag %(tagName)s to room"
"Failed to add tag %(tagName)s to room": "Failed to add tag %(tagName)s to room",
"Enable local event indexing and E2EE search (requires restart)": "Enable local event indexing and E2EE search (requires restart)"
}

View File

@ -120,6 +120,12 @@ export const SETTINGS = {
supportedLevels: LEVELS_FEATURE,
default: false,
},
"feature_event_indexing": {
isFeature: true,
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
displayName: _td("Enable local event indexing and E2EE search (requires restart)"),
default: false,
},
"useCiderComposer": {
displayName: _td("Use the new, faster, composer for writing messages"),
supportedLevels: LEVELS_ACCOUNT_SETTINGS,