support creating @room pills in partcreator

This commit is contained in:
Bruno Windels 2019-06-14 18:24:18 +02:00
parent eb4ff50c3c
commit dfec5058c5

View file

@ -260,6 +260,13 @@ class RoomPillPart extends PillPart {
} }
} }
class AtRoomPillPart extends RoomPillPart {
get type() {
return "at-room-pill";
}
}
class UserPillPart extends PillPart { class UserPillPart extends PillPart {
constructor(userId, displayName, member) { constructor(userId, displayName, member) {
super(userId, displayName); super(userId, displayName);
@ -402,6 +409,10 @@ export class PartCreator {
return new RoomPillPart(alias, room); return new RoomPillPart(alias, room);
} }
atRoomPill(text) {
return new AtRoomPillPart(text, this._room);
}
userPill(displayName, userId) { userPill(displayName, userId) {
const member = this._room.getMember(userId); const member = this._room.getMember(userId);
return new UserPillPart(userId, displayName, member); return new UserPillPart(userId, displayName, member);