From 55889d5491634a25abe8e02aa7b1f78367464ca3 Mon Sep 17 00:00:00 2001
From: David Baker <dave@matrix.org>
Date: Wed, 16 Jan 2019 15:07:30 +0000
Subject: [PATCH] Change wording of 'invite anyway' setting

https://github.com/vector-im/riot-web/issues/7922
---
 src/components/structures/UserSettings.js             |  2 +-
 src/components/views/dialogs/AskInviteAnywayDialog.js |  8 ++++----
 src/i18n/strings/en_EN.json                           | 10 ++++++----
 src/settings/Settings.js                              |  6 +++---
 src/utils/MultiInviter.js                             |  4 ++--
 5 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js
index 37f60c47bf..d476060e0b 100644
--- a/src/components/structures/UserSettings.js
+++ b/src/components/structures/UserSettings.js
@@ -86,7 +86,7 @@ const SIMPLE_SETTINGS = [
     { id: "pinMentionedRooms" },
     { id: "pinUnreadRooms" },
     { id: "showDeveloperTools" },
-    { id: "alwaysInviteUnknownUsers" },
+    { id: "promptBeforeInviteUnknownUsers" },
 ];
 
 // These settings must be defined in SettingsStore
diff --git a/src/components/views/dialogs/AskInviteAnywayDialog.js b/src/components/views/dialogs/AskInviteAnywayDialog.js
index 5c61c3a694..d4b073eb01 100644
--- a/src/components/views/dialogs/AskInviteAnywayDialog.js
+++ b/src/components/views/dialogs/AskInviteAnywayDialog.js
@@ -35,7 +35,7 @@ export default React.createClass({
     },
 
     _onInviteNeverWarnClicked: function() {
-        SettingsStore.setValue("alwaysInviteUnknownUsers", null, SettingLevel.ACCOUNT, true);
+        SettingsStore.setValue("promptBeforeInviteUnknownUsers", null, SettingLevel.ACCOUNT, false);
         this.props.onInviteAnyways();
         this.props.onFinished(true);
     },
@@ -58,7 +58,7 @@ export default React.createClass({
                 contentId='mx_Dialog_content'
             >
                 <div id='mx_Dialog_content'>
-                    <p>{_t("The following users may not exist - would you like to invite them anyways?")}</p>
+                    <p>{_t("Unable to find profiles for the Matrix IDs listed below - would you like to invite them anyway?")}</p>
                     <ul>
                         { errorList }
                     </ul>
@@ -69,10 +69,10 @@ export default React.createClass({
                         { _t('Close') }
                     </button>
                     <button onClick={this._onInviteNeverWarnClicked}>
-                        { _t('Invite anyways and never warn me again') }
+                        { _t('Invite anyway and never warn me again') }
                     </button>
                     <button onClick={this._onInviteClicked} autoFocus="true">
-                        { _t('Invite anyways') }
+                        { _t('Invite anyway') }
                     </button>
                 </div>
             </BaseDialog>
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json
index 4f8674db2f..c6701156cb 100644
--- a/src/i18n/strings/en_EN.json
+++ b/src/i18n/strings/en_EN.json
@@ -114,6 +114,8 @@
     "Failed to invite": "Failed to invite",
     "Failed to invite users to the room:": "Failed to invite users to the room:",
     "Failed to invite the following users to the %(roomName)s room:": "Failed to invite the following users to the %(roomName)s room:",
+    "Waiting for %(userId)s to accept...": "Waiting for %(userId)s to accept...",
+    "Waiting for %(userId)s to confirm...": "Waiting for %(userId)s to confirm...",
     "You need to be logged in.": "You need to be logged in.",
     "You need to be able to invite users to do that.": "You need to be able to invite users to do that.",
     "Unable to create widget.": "Unable to create widget.",
@@ -293,7 +295,7 @@
     "Pin unread rooms to the top of the room list": "Pin unread rooms to the top of the room list",
     "Enable widget screenshots on supported widgets": "Enable widget screenshots on supported widgets",
     "Show empty room list headings": "Show empty room list headings",
-    "Always invite users which may not exist": "Always invite users which may not exist",
+    "Prompt before sending invites to potentially invalid matrix IDs": "Prompt before sending invites to potentially invalid matrix IDs",
     "Show developer tools": "Show developer tools",
     "Collecting app version information": "Collecting app version information",
     "Collecting logs": "Collecting logs",
@@ -885,9 +887,9 @@
     "You have entered an invalid address.": "You have entered an invalid address.",
     "Try using one of the following valid address types: %(validTypesList)s.": "Try using one of the following valid address types: %(validTypesList)s.",
     "The following users may not exist": "The following users may not exist",
-    "The following users may not exist - would you like to invite them anyways?": "The following users may not exist - would you like to invite them anyways?",
-    "Invite anyways and never warn me again": "Invite anyways and never warn me again",
-    "Invite anyways": "Invite anyways",
+    "Unable to find profiles for the Matrix IDs listed below - would you like to invite them anyway?": "Unable to find profiles for the Matrix IDs listed below - would you like to invite them anyway?",
+    "Invite anyway and never warn me again": "Invite anyway and never warn me again",
+    "Invite anyway": "Invite anyway",
     "Preparing to send logs": "Preparing to send logs",
     "Logs sent": "Logs sent",
     "Thank you!": "Thank you!",
diff --git a/src/settings/Settings.js b/src/settings/Settings.js
index a007f78c1f..86377f3bc2 100644
--- a/src/settings/Settings.js
+++ b/src/settings/Settings.js
@@ -317,10 +317,10 @@ export const SETTINGS = {
         displayName: _td('Show empty room list headings'),
         default: true,
     },
-    "alwaysInviteUnknownUsers": {
+    "promptBeforeInviteUnknownUsers": {
         supportedLevels: LEVELS_ACCOUNT_SETTINGS,
-        displayName: _td('Always invite users which may not exist'),
-        default: false,
+        displayName: _td('Prompt before sending invites to potentially invalid matrix IDs'),
+        default: true,
     },
     "showDeveloperTools": {
         supportedLevels: LEVELS_ACCOUNT_SETTINGS,
diff --git a/src/utils/MultiInviter.js b/src/utils/MultiInviter.js
index b5f4f960a9..4278ee1c90 100644
--- a/src/utils/MultiInviter.js
+++ b/src/utils/MultiInviter.js
@@ -101,7 +101,7 @@ export default class MultiInviter {
         if (addrType === 'email') {
             return MatrixClientPeg.get().inviteByEmail(roomId, addr);
         } else if (addrType === 'mx-user-id') {
-            if (!ignoreProfile && !SettingsStore.getValue("alwaysInviteUnknownUsers", this.roomId)) {
+            if (!ignoreProfile && SettingsStore.getValue("promptBeforeInviteUnknownUsers", this.roomId)) {
                 try {
                     const profile = await MatrixClientPeg.get().getProfileInfo(addr);
                     if (!profile) {
@@ -204,7 +204,7 @@ export default class MultiInviter {
                         Promise.all(promises).then(() => this.deferred.resolve(this.completionStates));
                     };
 
-                    if (SettingsStore.getValue("alwaysInviteUnknownUsers", this.roomId)) {
+                    if (!SettingsStore.getValue("promptBeforeInviteUnknownUsers", this.roomId)) {
                         inviteUnknowns();
                         return;
                     }