Merge pull request #5624 from SimonBrandner/show-room-name
Display room name in pills instead of address
This commit is contained in:
commit
b12cf7912a
3 changed files with 49 additions and 9 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue