From 2c2091438e6c4d2dee4c5d25d37e2f2621f43d16 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Tue, 20 Jun 2017 15:46:54 +0100 Subject: [PATCH] Fix ability to invite users with caps in their user IDs By lowercasing only when testing against local user IDs/display names. The user_directory shouldn't care. And when we make the placeholder "We didn't get any results, but here's the user with the exact mxid you typed in", use the original query. --- src/components/views/dialogs/ChatInviteDialog.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/views/dialogs/ChatInviteDialog.js b/src/components/views/dialogs/ChatInviteDialog.js index 9a14cb91d3..a85efadef7 100644 --- a/src/components/views/dialogs/ChatInviteDialog.js +++ b/src/components/views/dialogs/ChatInviteDialog.js @@ -178,7 +178,7 @@ module.exports = React.createClass({ }, onQueryChanged: function(ev) { - const query = ev.target.value.toLowerCase(); + const query = ev.target.value; if (this.queryChangedDebouncer) { clearTimeout(this.queryChangedDebouncer); } @@ -271,10 +271,11 @@ module.exports = React.createClass({ query, searchError: null, }); + const queryLowercase = query.toLowerCase(); const results = []; MatrixClientPeg.get().getUsers().forEach((user) => { - if (user.userId.toLowerCase().indexOf(query) === -1 && - user.displayName.toLowerCase().indexOf(query) === -1 + if (user.userId.toLowerCase().indexOf(queryLowercase) === -1 && + user.displayName.toLowerCase().indexOf(queryLowercase) === -1 ) { return; }