Rich message rendering #24

Merged
cadence merged 28 commits from rich-messages into princess 2020-11-07 10:46:48 +00:00
Showing only changes of commit 66ecf44048 - Show all commits

View file

@ -6,7 +6,7 @@ function createMembershipEvent(membership, message) {
return simpleEvent((e) => e.type == "m.room.member" && e.content.membership === membership, message) return simpleEvent((e) => e.type == "m.room.member" && e.content.membership === membership, message)
bad marked this conversation as resolved Outdated

Again here. I think a better way would be to have a base class like MembershipEvent, and then for each kind of membership we subclass it and only implement the canRender method on each.

Again here. I think a better way would be to have a base class like MembershipEvent, and then for each kind of membership we subclass it and only implement the canRender method on each.
} }
const JoinedEvent = createMembershipEvent("join", (e) => {console.log(e); return "joined the room"}) const JoinedEvent = createMembershipEvent("join", (e) => "joined the room")
const InvitedEvent = createMembershipEvent("invite", (e) => `invited ${e.content.displayname} the room`) const InvitedEvent = createMembershipEvent("invite", (e) => `invited ${e.content.displayname} the room`)
const LeaveEvent = createMembershipEvent("leave", () => "left the room") const LeaveEvent = createMembershipEvent("leave", () => "left the room")