You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-16 06:42:26 +03:00
filter room list by canonical and alternative aliases
This commit is contained in:
@@ -596,8 +596,13 @@ export default createReactClass({
|
|||||||
// case insensitive if room name includes filter,
|
// case insensitive if room name includes filter,
|
||||||
// or if starts with `#` and one of room's aliases starts with filter
|
// or if starts with `#` and one of room's aliases starts with filter
|
||||||
return list.filter((room) => {
|
return list.filter((room) => {
|
||||||
if (filter[0] === "#" && room.getAliases().some((alias) => alias.toLowerCase().startsWith(lcFilter))) {
|
if (filter[0] === "#") {
|
||||||
return true;
|
if (room.getCanonicalAlias() && room.getCanonicalAlias().toLowerCase().startsWith(lcFilter)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (room.getAltAliases().some((alias) => alias.toLowerCase().startsWith(lcFilter))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return room.name && utils.removeHiddenChars(room.name.toLowerCase()).toLowerCase().includes(fuzzyFilter);
|
return room.name && utils.removeHiddenChars(room.name.toLowerCase()).toLowerCase().includes(fuzzyFilter);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user