From b881efbc05ac7b013abd8b0596843e6539617946 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 20 Jul 2017 15:16:25 +0100 Subject: [PATCH] Default to first room alias and then roomID --- src/components/views/rooms/MessageComposerInput.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/views/rooms/MessageComposerInput.js b/src/components/views/rooms/MessageComposerInput.js index d42f4a69bb..f841796f87 100644 --- a/src/components/views/rooms/MessageComposerInput.js +++ b/src/components/views/rooms/MessageComposerInput.js @@ -43,6 +43,7 @@ import {Completion} from "../../../autocomplete/Autocompleter"; import Markdown from '../../../Markdown'; import ComposerHistoryManager from '../../../ComposerHistoryManager'; import MessageComposerStore from '../../../stores/MessageComposerStore'; +import { getDisplayAliasForRoom } from '../../../Rooms'; import {MATRIXTO_URL_PATTERN} from '../../../linkify-matrix'; const REGEX_MATRIXTO = new RegExp(MATRIXTO_URL_PATTERN); @@ -225,7 +226,7 @@ export default class MessageComposerInput extends React.Component { return r.getCanonicalAlias() === resource; }) : MatrixClientPeg.get().getRoom(resource); - linkText = room.getCanonicalAlias(); + linkText = Rooms.getDisplayAliasForRoom(room) || resource; avatar = room ? : null; }