You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-30 02:21:17 +03:00
Refactor pill and add tests (#10304)
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user