diff --git a/src/components/views/dialogs/UserPickerDialog.js b/src/components/views/dialogs/UserPickerDialog.js
index b2fdd7035d..2bd2320b21 100644
--- a/src/components/views/dialogs/UserPickerDialog.js
+++ b/src/components/views/dialogs/UserPickerDialog.js
@@ -40,6 +40,7 @@ module.exports = React.createClass({
focus: PropTypes.bool,
validAddressTypes: PropTypes.arrayOf(PropTypes.oneOf(addressTypes)),
onFinished: PropTypes.func.isRequired,
+ groupId: PropTypes.string,
},
getDefaultProps: function() {
@@ -140,7 +141,9 @@ module.exports = React.createClass({
// Only do search if there is something to search
if (query.length > 0 && query != '@' && query.length >= 2) {
this.queryChangedDebouncer = setTimeout(() => {
- if (this.state.serverSupportsUserDirectory) {
+ if (this.props.groupId) {
+ this._doNaiveGroupSearch(query);
+ } else if (this.state.serverSupportsUserDirectory) {
this._doUserDirectorySearch(query);
} else {
this._doLocalSearch(query);
@@ -185,6 +188,26 @@ module.exports = React.createClass({
if (this._cancelThreepidLookup) this._cancelThreepidLookup();
},
+ _doNaiveGroupSearch: function(query) {
+ this.setState({
+ busy: true,
+ query,
+ searchError: null,
+ });
+ MatrixClientPeg.get().getGroupUsers(this.props.groupId).then((resp) => {
+ this._processResults(resp.chunk, query);
+ }).catch((err) => {
+ console.error('Error whilst searching user directory: ', err);
+ this.setState({
+ searchError: err.errcode ? err.message : _t('Something went wrong!'),
+ });
+ }).done(() => {
+ this.setState({
+ busy: false,
+ });
+ });
+ },
+
_doUserDirectorySearch: function(query) {
this.setState({
busy: true,
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json
index 2d1361b55e..8c8c2e4ac0 100644
--- a/src/i18n/strings/en_EN.json
+++ b/src/i18n/strings/en_EN.json
@@ -888,5 +888,8 @@
"Robot check is currently unavailable on desktop - please use a
web browser": "Robot check is currently unavailable on desktop - please use a
web browser",
"Flair": "Flair",
"Add a Room": "Add a Room",
- "Add a User": "Add a User"
+ "Add a User": "Add a User",
+ "Add users to the group summary": "Add users to the group summary",
+ "Who would you like to add to this summary?": "Who would you like to add to this summary?",
+ "Add to summary": "Add to summary"
}