From cb5237a18be0bf17eede4768f8978dfc44e7c609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Fri, 12 Feb 2021 14:21:07 +0100 Subject: [PATCH] Display room name instead of alias MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/editor/parts.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/editor/parts.ts b/src/editor/parts.ts index 8a7ccfcb7b..67f6a2c0c5 100644 --- a/src/editor/parts.ts +++ b/src/editor/parts.ts @@ -329,8 +329,8 @@ class NewlinePart extends BasePart implements IBasePart { } class RoomPillPart extends PillPart { - constructor(displayAlias, private room: Room) { - super(displayAlias, displayAlias); + constructor(resourceId: string, label: string, private room: Room) { + super(resourceId, label); } setAvatar(node: HTMLElement) { @@ -357,6 +357,10 @@ class RoomPillPart extends PillPart { } class AtRoomPillPart extends RoomPillPart { + constructor(text: string, room: Room) { + super(text, text, room); + } + get type(): IPillPart["type"] { return Type.AtRoomPill; } @@ -521,7 +525,7 @@ export class PartCreator { r.getAltAliases().includes(alias); }); } - return new RoomPillPart(alias, room); + return new RoomPillPart(alias, room ? room.name : alias, room); } atRoomPill(text: string) {