diff --git a/src/components/views/dialogs/ChatInviteDialog.js b/src/components/views/dialogs/ChatInviteDialog.js index 9b1bb1752a..7ed7be1c15 100644 --- a/src/components/views/dialogs/ChatInviteDialog.js +++ b/src/components/views/dialogs/ChatInviteDialog.js @@ -211,6 +211,11 @@ module.exports = React.createClass({ var uid = user.userId.toLowerCase(); query = query.toLowerCase(); + // dount match any that are already on the invite list + if (this._isOnInviteList(uid)) { + return false; + } + // direct prefix matches if (name.indexOf(query) === 0 || uid.indexOf(query) === 0) { return true; @@ -231,6 +236,15 @@ module.exports = React.createClass({ return false; }, + _isOnInviteList: function(uid) { + for (let i = 0; i < this.state.inviteList.length; i++) { + if (this.state.inviteList[i].userId.toLowerCase() === uid) { + return true; + } + } + return false; + }, + render: function() { var TintableSvg = sdk.getComponent("elements.TintableSvg"); var AddressSelector = sdk.getComponent("elements.AddressSelector");