Merge pull request #4096 from matrix-org/bwindels/canonicalpill

Accept canonical alias for pills
This commit is contained in:
Bruno Windels 2020-02-20 17:07:54 +00:00 committed by GitHub
commit 744826db48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -128,7 +128,8 @@ const Pill = createReactClass({
case Pill.TYPE_ROOM_MENTION: { case Pill.TYPE_ROOM_MENTION: {
const localRoom = resourceId[0] === '#' ? const localRoom = resourceId[0] === '#' ?
MatrixClientPeg.get().getRooms().find((r) => { MatrixClientPeg.get().getRooms().find((r) => {
return r.getAliases().includes(resourceId); return r.getCanonicalAlias() === resourceId ||
r.getAliases().includes(resourceId);
}) : MatrixClientPeg.get().getRoom(resourceId); }) : MatrixClientPeg.get().getRoom(resourceId);
room = localRoom; room = localRoom;
if (!localRoom) { if (!localRoom) {