Source

models/events/RoomTopicEvent.ts

  1. import { StateEvent } from "./RoomEvent";
  2. /**
  3. * The content definition for m.room.topic events
  4. * @category Matrix event contents
  5. * @see RoomTopicEvent
  6. */
  7. export interface RoomTopicEventContent {
  8. topic: string;
  9. }
  10. /**
  11. * Represents an m.room.topic state event
  12. * @category Matrix events
  13. */
  14. export class RoomTopicEvent extends StateEvent<RoomTopicEventContent> {
  15. constructor(event: any) {
  16. super(event);
  17. }
  18. /**
  19. * The topic of the room.
  20. */
  21. public get topic(): string {
  22. return this.content.topic;
  23. }
  24. }