diff --git a/src/components/views/dialogs/AddressPickerDialog.js b/src/components/views/dialogs/AddressPickerDialog.js
index c72510cbe7..4610388afc 100644
--- a/src/components/views/dialogs/AddressPickerDialog.js
+++ b/src/components/views/dialogs/AddressPickerDialog.js
@@ -419,7 +419,7 @@ module.exports = React.createClass({
address: addressText,
isKnown: false,
};
- if (addrType == null) {
+ if (!this.props.validAddressTypes.includes(addrType)) {
this.setState({ error: true });
return null;
} else if (addrType == 'mx-user-id') {
@@ -517,8 +517,21 @@ module.exports = React.createClass({
let error;
let addressSelector;
if (this.state.error) {
+ let tryUsing = '';
+ const validTypeDescriptions = this.props.validAddressTypes.map((t) => {
+ return {
+ 'mx-user-id': _t("Matrix ID"),
+ 'mx-room-id': _t("Matrix Room ID"),
+ 'email': _t("email address"),
+ }[t];
+ });
+ tryUsing = _t("Try using one of the following valid address types: %(validTypesList)s.", {
+ validTypesList: validTypeDescriptions.join(", "),
+ });
error =
- {_t("You have entered an invalid contact. Try using their Matrix ID or email address.")}
+ {_t("You have entered an invalid address.")}
+
+ {tryUsing}
;
} else if (this.state.searchError) {
error = {this.state.searchError}
;
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json
index 09b3f045df..a4219d7467 100644
--- a/src/i18n/strings/en_EN.json
+++ b/src/i18n/strings/en_EN.json
@@ -891,5 +891,10 @@
"Unpublish": "Unpublish",
"This group is published on your profile": "This group is published on your profile",
"Publish": "Publish",
- "This group is not published on your profile": "This group is not published on your profile"
+ "This group is not published on your profile": "This group is not published on your profile",
+ "Matrix ID": "Matrix ID",
+ "Matrix Room ID": "Matrix Room ID",
+ "email address": "email address",
+ "Try using one of the following valid address types: %(validTypesList)s.": "Try using one of the following valid address types: %(validTypesList)s.",
+ "You have entered an invalid address.": "You have entered an invalid address."
}