Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit dcd0103

Browse files
Luke Barnarddbkr
authored andcommitted
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.
1 parent 2db24f3 commit dcd0103

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/views/dialogs/ChatInviteDialog.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ module.exports = React.createClass({
178178
},
179179

180180
onQueryChanged: function(ev) {
181-
const query = ev.target.value.toLowerCase();
181+
const query = ev.target.value;
182182
if (this.queryChangedDebouncer) {
183183
clearTimeout(this.queryChangedDebouncer);
184184
}
@@ -271,10 +271,11 @@ module.exports = React.createClass({
271271
query,
272272
searchError: null,
273273
});
274+
const queryLowercase = query.toLowerCase();
274275
const results = [];
275276
MatrixClientPeg.get().getUsers().forEach((user) => {
276-
if (user.userId.toLowerCase().indexOf(query) === -1 &&
277-
user.displayName.toLowerCase().indexOf(query) === -1
277+
if (user.userId.toLowerCase().indexOf(queryLowercase) === -1 &&
278+
user.displayName.toLowerCase().indexOf(queryLowercase) === -1
278279
) {
279280
return;
280281
}

0 commit comments

Comments
 (0)