diff --git a/src/components/views/dialogs/InviteDialog.js b/src/components/views/dialogs/InviteDialog.js
index 80d8f1fc2c..73101056f3 100644
--- a/src/components/views/dialogs/InviteDialog.js
+++ b/src/components/views/dialogs/InviteDialog.js
@@ -38,6 +38,8 @@ import {Action} from "../../../dispatcher/actions";
import {DefaultTagID} from "../../../stores/room-list/models";
import RoomListStore from "../../../stores/room-list/RoomListStore";
import {CommunityPrototypeStore} from "../../../stores/CommunityPrototypeStore";
+import SettingsStore from "../../../settings/SettingsStore";
+import {UIFeature} from "../../../settings/UIFeature";
// we have a number of types defined from the Matrix spec which can't reasonably be altered here.
/* eslint-disable camelcase */
@@ -549,7 +551,7 @@ export default class InviteDialog extends React.PureComponent {
if (this.state.filterText.startsWith('@')) {
// Assume mxid
newMember = new DirectoryMember({user_id: this.state.filterText, display_name: null, avatar_url: null});
- } else {
+ } else if (SettingsStore.getValue(UIFeature.IdentityServer)) {
// Assume email
newMember = new ThreepidMember(this.state.filterText);
}
@@ -734,7 +736,7 @@ export default class InviteDialog extends React.PureComponent {
this.setState({tryingIdentityServer: true});
return;
}
- if (term.indexOf('@') > 0 && Email.looksValid(term)) {
+ if (term.indexOf('@') > 0 && Email.looksValid(term) && SettingsStore.getValue(UIFeature.IdentityServer)) {
// Start off by suggesting the plain email while we try and resolve it
// to a real account.
this.setState({
@@ -1037,7 +1039,9 @@ export default class InviteDialog extends React.PureComponent {
}
_renderIdentityServerWarning() {
- if (!this.state.tryingIdentityServer || this.state.canUseIdentityServer) {
+ if (!this.state.tryingIdentityServer || this.state.canUseIdentityServer ||
+ !SettingsStore.getValue(UIFeature.IdentityServer)
+ ) {
return null;
}
@@ -1086,22 +1090,38 @@ export default class InviteDialog extends React.PureComponent {
let buttonText;
let goButtonFn;
+ const identityServersEnabled = SettingsStore.getValue(UIFeature.IdentityServer);
+
const userId = MatrixClientPeg.get().getUserId();
if (this.props.kind === KIND_DM) {
title = _t("Direct Messages");
- helpText = _t(
- "Start a conversation with someone using their name, username (like ) or email address.",
- {},
- {userId: () => {
- return {userId};
- }},
- );
+
+ if (identityServersEnabled) {
+ helpText = _t(
+ "Start a conversation with someone using their name, username (like ) or email address.",
+ {},
+ {userId: () => {
+ return (
+ {userId}
+ );
+ }},
+ );
+ } else {
+ helpText = _t(
+ "Start a conversation with someone using their name or username (like ).",
+ {},
+ {userId: () => {
+ return (
+ {userId}
+ );
+ }},
+ );
+ }
+
if (CommunityPrototypeStore.instance.getSelectedCommunityId()) {
const communityName = CommunityPrototypeStore.instance.getSelectedCommunityName();
- helpText = _t(
- "Start a conversation with someone using their name, username (like ) or email address. " +
- "This won't invite them to %(communityName)s. To invite someone to %(communityName)s, click " +
- "here.",
+ const inviteText = _t("This won't invite them to %(communityName)s. " +
+ "To invite someone to %(communityName)s, click here",
{communityName}, {
userId: () => {
return (
@@ -1122,21 +1142,40 @@ export default class InviteDialog extends React.PureComponent {
},
},
);
+ helpText =
+ { helpText } {inviteText}
+ ;
}
buttonText = _t("Go");
goButtonFn = this._startDm;
} else { // KIND_INVITE
title = _t("Invite to this room");
- helpText = _t(
- "Invite someone using their name, username (like ), email address or share this room.",
- {},
- {
- userId: () =>
- {userId},
- a: (sub) =>
- {sub},
- },
- );
+
+ if (identityServersEnabled) {
+ helpText = _t(
+ "Invite someone using their name, username (like ), email address or " +
+ "share this room.",
+ {},
+ {
+ userId: () =>
+ {userId},
+ a: (sub) =>
+ {sub},
+ },
+ );
+ } else {
+ helpText = _t(
+ "Invite someone using their name, username (like ) or share this room.",
+ {},
+ {
+ userId: () =>
+ {userId},
+ a: (sub) =>
+ {sub},
+ },
+ );
+ }
+
buttonText = _t("Invite");
goButtonFn = this._inviteUsers;
}
diff --git a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js
index 43cc37b3e7..abdbb7c582 100644
--- a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js
+++ b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js
@@ -394,14 +394,21 @@ export default class GeneralUserSettingsTab extends React.Component {
>;
}
+ let discoverySection;
+ if (SettingsStore.getValue(UIFeature.IdentityServer)) {
+ discoverySection = <>
+
{discoWarning} {_t("Discovery")}
+ {this._renderDiscoverySection()}
+ >;
+ }
+
return (
{_t("General")}
{this._renderProfileSection()}
{this._renderAccountSection()}
{this._renderLanguageSection()}
-
{discoWarning} {_t("Discovery")}
- {this._renderDiscoverySection()}
+ { discoverySection }
{this._renderIntegrationManagerSection() /* Has its own title */}
{ accountManagementSection }
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json
index d91fe475df..4c2a55d09e 100644
--- a/src/i18n/strings/en_EN.json
+++ b/src/i18n/strings/en_EN.json
@@ -833,8 +833,8 @@
"Deactivating your account is a permanent action - be careful!": "Deactivating your account is a permanent action - be careful!",
"Deactivate Account": "Deactivate Account",
"Deactivate account": "Deactivate account",
- "General": "General",
"Discovery": "Discovery",
+ "General": "General",
"Legal": "Legal",
"Credits": "Credits",
"For help with using %(brand)s, click here.": "For help with using %(brand)s, click here.",
@@ -1732,9 +1732,11 @@
"Recently Direct Messaged": "Recently Direct Messaged",
"Direct Messages": "Direct Messages",
"Start a conversation with someone using their name, username (like ) or email address.": "Start a conversation with someone using their name, username (like ) or email address.",
- "Start a conversation with someone using their name, username (like ) or email address. This won't invite them to %(communityName)s. To invite someone to %(communityName)s, click here.": "Start a conversation with someone using their name, username (like ) or email address. This won't invite them to %(communityName)s. To invite someone to %(communityName)s, click here.",
+ "Start a conversation with someone using their name or username (like ).": "Start a conversation with someone using their name or username (like ).",
+ "This won't invite them to %(communityName)s. To invite someone to %(communityName)s, click here": "This won't invite them to %(communityName)s. To invite someone to %(communityName)s, click here",
"Go": "Go",
"Invite someone using their name, username (like ), email address or share this room.": "Invite someone using their name, username (like ), email address or share this room.",
+ "Invite someone using their name, username (like ) or share this room.": "Invite someone using their name, username (like ) or share this room.",
"a new master key signature": "a new master key signature",
"a new cross-signing key signature": "a new cross-signing key signature",
"a device cross-signing signature": "a device cross-signing signature",
diff --git a/src/settings/Settings.ts b/src/settings/Settings.ts
index cc7d0726ed..82d37af030 100644
--- a/src/settings/Settings.ts
+++ b/src/settings/Settings.ts
@@ -651,4 +651,8 @@ export const SETTINGS: {[setting: string]: ISetting} = {
supportedLevels: LEVELS_UI_FEATURE,
default: true,
},
+ [UIFeature.IdentityServer]: {
+ supportedLevels: LEVELS_UI_FEATURE,
+ default: true,
+ },
};
diff --git a/src/settings/UIFeature.ts b/src/settings/UIFeature.ts
index d8bae1befd..81fe682521 100644
--- a/src/settings/UIFeature.ts
+++ b/src/settings/UIFeature.ts
@@ -25,4 +25,5 @@ export enum UIFeature {
Deactivate = "UIFeature.deactivate",
ShareQRCode = "UIFeature.shareQrCode",
ShareSocial = "UIFeature.shareSocial",
+ IdentityServer = "UIFeature.identityServer",
}