diff --git a/src/components/structures/GroupView.js b/src/components/structures/GroupView.js index f90ba31653..9c20f75e46 100644 --- a/src/components/structures/GroupView.js +++ b/src/components/structures/GroupView.js @@ -239,6 +239,7 @@ const RoleUserList = React.createClass({ button: _t("Add to summary"), validAddressTypes: ['mx'], groupId: this.props.groupId, + shouldOmitSelf: false, onFinished: (success, addrs) => { if (!success) return; const errorList = []; diff --git a/src/components/views/dialogs/AddressPickerDialog.js b/src/components/views/dialogs/AddressPickerDialog.js index 22cf242fcf..f168a411f5 100644 --- a/src/components/views/dialogs/AddressPickerDialog.js +++ b/src/components/views/dialogs/AddressPickerDialog.js @@ -41,7 +41,11 @@ module.exports = React.createClass({ validAddressTypes: PropTypes.arrayOf(PropTypes.oneOf(addressTypes)), onFinished: PropTypes.func.isRequired, groupId: PropTypes.string, + // The type of entity to search for. Default: 'user'. pickerType: PropTypes.oneOf(['user', 'room']), + // Whether the current user should be omitted from the address returned. Only + // applicable when pickerType is `user`. Default: true. + shouldOmitSelf: PropTypes.bool, }, getDefaultProps: function() { @@ -50,6 +54,7 @@ module.exports = React.createClass({ focus: true, validAddressTypes: addressTypes, pickerType: 'user', + shouldOmitSelf: true, }; }, @@ -366,7 +371,9 @@ module.exports = React.createClass({ }); return; } - if (result.user_id === MatrixClientPeg.get().credentials.userId) { + if (this.props.shouldOmitSelf && + result.user_id === MatrixClientPeg.get().credentials.userId + ) { return; }