mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-24 07:51:34 +02:00
support creating @room pills in partcreator
This commit is contained in:
parent
eb4ff50c3c
commit
dfec5058c5
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user