diff --git a/res/css/views/dialogs/_UserSettingsDialog.scss b/res/css/views/dialogs/_UserSettingsDialog.scss
index 2a046ff501..4d831d7858 100644
--- a/res/css/views/dialogs/_UserSettingsDialog.scss
+++ b/res/css/views/dialogs/_UserSettingsDialog.scss
@@ -45,6 +45,10 @@ limitations under the License.
mask-image: url('$(res)/img/feather-customised/flag.svg');
}
+.mx_UserSettingsDialog_mjolnirIcon::before {
+ mask-image: url('$(res)/img/feather-customised/face.svg');
+}
+
.mx_UserSettingsDialog_flairIcon::before {
mask-image: url('$(res)/img/feather-customised/flair.svg');
}
diff --git a/src/components/views/dialogs/UserSettingsDialog.js b/src/components/views/dialogs/UserSettingsDialog.js
index fb9045f05a..6e324ad3fb 100644
--- a/src/components/views/dialogs/UserSettingsDialog.js
+++ b/src/components/views/dialogs/UserSettingsDialog.js
@@ -1,5 +1,6 @@
/*
Copyright 2019 New Vector Ltd
+Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -29,12 +30,34 @@ import HelpUserSettingsTab from "../settings/tabs/user/HelpUserSettingsTab";
import FlairUserSettingsTab from "../settings/tabs/user/FlairUserSettingsTab";
import sdk from "../../../index";
import SdkConfig from "../../../SdkConfig";
+import MjolnirUserSettingsTab from "../settings/tabs/user/MjolnirUserSettingsTab";
export default class UserSettingsDialog extends React.Component {
static propTypes = {
onFinished: PropTypes.func.isRequired,
};
+ constructor() {
+ super();
+
+ this.state = {
+ mjolnirEnabled: SettingsStore.isFeatureEnabled("feature_mjolnir"),
+ }
+ }
+
+ componentDidMount(): void {
+ this._mjolnirWatcher = SettingsStore.watchSetting("feature_mjolnir", null, this._mjolnirChanged.bind(this));
+ }
+
+ componentWillUnmount(): void {
+ SettingsStore.unwatchSetting(this._mjolnirWatcher);
+ }
+
+ _mjolnirChanged(settingName, roomId, atLevel, newValue) {
+ // We can cheat because we know what levels a feature is tracked at, and how it is tracked
+ this.setState({mjolnirEnabled: newValue});
+ }
+
_getTabs() {
const tabs = [];
@@ -75,6 +98,13 @@ export default class UserSettingsDialog extends React.Component {
@bot:*
" +
+ "would ignore all users that have the name 'bot' on any server.",
+ {}, {code: (s) => {s}
},
+ )}TODO
+TODO
+@bot:*
would ignore all users that have the name 'bot' on any server.": "Add users and servers you want to ignore here. Use asterisks to have Riot match any characters. For example, @bot:*
would ignore all users that have the name 'bot' on any server.",
+ "Ignoring people is done through ban lists which contain rules for who to ban. Subscribing to a ban list means the users/servers blocked by that list will be hidden from you.": "Ignoring people is done through ban lists which contain rules for who to ban. Subscribing to a ban list means the users/servers blocked by that list will be hidden from you.",
+ "Personal ban list": "Personal ban list",
+ "Your personal ban list holds all the users/servers you personally don't want to see messages from. After ignoring your first user/server, a new room will show up in your room list named 'My Ban List' - stay in this room to keep the ban list in effect.": "Your personal ban list holds all the users/servers you personally don't want to see messages from. After ignoring your first user/server, a new room will show up in your room list named 'My Ban List' - stay in this room to keep the ban list in effect.",
+ "Subscribed lists": "Subscribed lists",
+ "Subscribing to a ban list will cause you to join it!": "Subscribing to a ban list will cause you to join it!",
+ "If this isn't what you want, please use a different tool to ignore users.": "If this isn't what you want, please use a different tool to ignore users.",
"Notifications": "Notifications",
"Start automatically after system login": "Start automatically after system login",
"Always show the window menu bar": "Always show the window menu bar",
@@ -654,7 +664,6 @@
"Cryptography": "Cryptography",
"Device ID:": "Device ID:",
"Device key:": "Device key:",
- "Ignored users": "Ignored users",
"Bulk options": "Bulk options",
"Accept all %(invitedRooms)s invites": "Accept all %(invitedRooms)s invites",
"Reject all %(invitedRooms)s invites": "Reject all %(invitedRooms)s invites",
diff --git a/src/settings/Settings.js b/src/settings/Settings.js
index 7470641359..1cfff0182e 100644
--- a/src/settings/Settings.js
+++ b/src/settings/Settings.js
@@ -126,6 +126,20 @@ export const SETTINGS = {
supportedLevels: LEVELS_FEATURE,
default: false,
},
+ "feature_mjolnir": {
+ isFeature: true,
+ displayName: _td("Try out new ways to ignore people (experimental)"),
+ supportedLevels: LEVELS_FEATURE,
+ default: false,
+ },
+ "mjolnirRooms": {
+ supportedLevels: ['account'],
+ default: [],
+ },
+ "mjolnirPersonalRoom": {
+ supportedLevels: ['account'],
+ default: null,
+ },
"useCiderComposer": {
displayName: _td("Use the new, faster, composer for writing messages"),
supportedLevels: LEVELS_ACCOUNT_SETTINGS,