Refactor pill and add tests (#10304)
This commit is contained in:
parent
c0e40217f3
commit
ad26925bb6
10 changed files with 653 additions and 275 deletions
|
@ -679,12 +679,13 @@ export const mkSpace = (
|
|||
return space;
|
||||
};
|
||||
|
||||
export const mkRoomMemberJoinEvent = (user: string, room: string): MatrixEvent => {
|
||||
export const mkRoomMemberJoinEvent = (user: string, room: string, content?: IContent): MatrixEvent => {
|
||||
return mkEvent({
|
||||
event: true,
|
||||
type: EventType.RoomMember,
|
||||
content: {
|
||||
membership: "join",
|
||||
...content,
|
||||
},
|
||||
skey: user,
|
||||
user,
|
||||
|
@ -692,6 +693,19 @@ export const mkRoomMemberJoinEvent = (user: string, room: string): MatrixEvent =
|
|||
});
|
||||
};
|
||||
|
||||
export const mkRoomCanonicalAliasEvent = (userId: string, roomId: string, alias: string): MatrixEvent => {
|
||||
return mkEvent({
|
||||
event: true,
|
||||
type: EventType.RoomCanonicalAlias,
|
||||
content: {
|
||||
alias,
|
||||
},
|
||||
skey: "",
|
||||
user: userId,
|
||||
room: roomId,
|
||||
});
|
||||
};
|
||||
|
||||
export const mkThirdPartyInviteEvent = (user: string, displayName: string, room: string): MatrixEvent => {
|
||||
return mkEvent({
|
||||
event: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue