Type Alias RoomEventHandlerMap

RoomEventHandlerMap: {
    Poll.new: ((poll: Poll) => void);
    Room.accountData: ((event: MatrixEvent, room: Room, prevEvent?: MatrixEvent) => void);
    Room.CurrentStateUpdated: ((room: Room, previousRoomState: RoomState, roomState: RoomState) => void);
    Room.historyImportedWithinTimeline: ((markerEvent: MatrixEvent, room: Room) => void);
    Room.localEchoUpdated: ((event: MatrixEvent, room: Room, oldEventId?: string, oldStatus?: EventStatus | null) => void);
    Room.myMembership: ((room: Room, membership: Membership, prevMembership?: Membership) => void);
    Room.name: ((room: Room) => void);
    Room.OldStateUpdated: ((room: Room, previousRoomState: RoomState, roomState: RoomState) => void);
    Room.receipt: ((event: MatrixEvent, room: Room) => void);
    Room.redaction: ((event: MatrixEvent, room: Room, threadId?: string) => void);
    Room.redactionCancelled: ((event: MatrixEvent, room: Room) => void);
    Room.Summary: ((summary: IRoomSummary) => void);
    Room.tags: ((event: MatrixEvent, room: Room) => void);
    Room.TimelineRefresh: ((room: Room, eventTimelineSet: EventTimelineSet) => void);
    Room.UnreadNotifications: ((unreadNotifications?: NotificationCount, threadId?: string) => void);
    Thread.new: ((thread: Thread, toStartOfTimeline: boolean) => void);
} & Pick<ThreadEventHandlerMap, Update | NewReply | Delete> & EventTimelineSetHandlerMap & Pick<MatrixEventHandlerMap, BeforeRedaction> & Pick<RoomStateEventHandlerMap,
    | Events
    | Members
    | NewMember
    | Update
    | Marker
    | New> & Pick<BeaconEventHandlerMap, Update | Destroy | LivenessChange>

Type declaration

  • Poll.new: ((poll: Poll) => void)

    Fires when a new poll instance is added to the room state

      • (poll): void
      • Parameters

        • poll: Poll

          the new poll

        Returns void

  • Room.accountData: ((event: MatrixEvent, room: Room, prevEvent?: MatrixEvent) => void)

    Fires whenever a room's account_data is updated.

    matrixClient.on("Room.accountData", function(event, room, oldEvent){
    if (event.getType() === "m.room.colorscheme") {
    applyColorScheme(event.getContents());
    }
    });
      • (event, room, prevEvent?): void
      • Parameters

        • event: MatrixEvent

          The account_data event

        • room: Room

          The room whose account_data was updated.

        • OptionalprevEvent: MatrixEvent

          The event being replaced by the new account data, if known.

        Returns void

  • Room.CurrentStateUpdated: ((room: Room, previousRoomState: RoomState, roomState: RoomState) => void)
      • (room, previousRoomState, roomState): void
      • Parameters

        Returns void

  • Room.historyImportedWithinTimeline: ((markerEvent: MatrixEvent, room: Room) => void)
      • (markerEvent, room): void
      • Parameters

        Returns void

  • Room.localEchoUpdated: ((event: MatrixEvent, room: Room, oldEventId?: string, oldStatus?: EventStatus | null) => void)

    Fires when the status of a transmitted event is updated.

    When an event is first transmitted, a temporary copy of the event is inserted into the timeline, with a temporary event id, and a status of 'SENDING'.

    Once the echo comes back from the server, the content of the event (MatrixEvent.event) is replaced by the complete event from the homeserver, thus updating its event id, as well as server-generated fields such as the timestamp. Its status is set to null.

    Once the /send request completes, if the remote echo has not already arrived, the event is updated with a new event id and the status is set to 'SENT'. The server-generated fields are of course not updated yet.

    If the /send fails, In this case, the event's status is set to 'NOT_SENT'. If it is later resent, the process starts again, setting the status to 'SENDING'. Alternatively, the message may be cancelled, which removes the event from the room, and sets the status to 'CANCELLED'.

    This event is raised to reflect each of the transitions above.

      • (event, room, oldEventId?, oldStatus?): void
      • Parameters

        • event: MatrixEvent

          The matrix event which has been updated

        • room: Room

          The room containing the redacted event

        • OptionaloldEventId: string

          The previous event id (the temporary event id, except when updating a successfully-sent event when its echo arrives)

        • OptionaloldStatus: EventStatus | null

          The previous event status.

        Returns void

  • Room.myMembership: ((room: Room, membership: Membership, prevMembership?: Membership) => void)

    Fires when the logged in user's membership in the room is updated.

      • (room, membership, prevMembership?): void
      • Parameters

        • room: Room

          The room in which the membership has been updated

        • membership: Membership

          The new membership value

        • OptionalprevMembership: Membership

          The previous membership value

        Returns void

  • Room.name: ((room: Room) => void)

    Fires whenever the name of a room is updated.

    matrixClient.on("Room.name", function(room){
    var newName = room.name;
    });
      • (room): void
      • Parameters

        Returns void

  • Room.OldStateUpdated: ((room: Room, previousRoomState: RoomState, roomState: RoomState) => void)
      • (room, previousRoomState, roomState): void
      • Parameters

        Returns void

  • Room.receipt: ((event: MatrixEvent, room: Room) => void)

    Fires whenever a receipt is received for a room

    matrixClient.on("Room.receipt", function(event, room){
    var receiptContent = event.getContent();
    });
      • (event, room): void
      • Parameters

        • event: MatrixEvent

          The receipt event

        • room: Room

          The room whose receipts was updated.

        Returns void

  • Room.redaction: ((event: MatrixEvent, room: Room, threadId?: string) => void)

    Fires when an event we had previously received is redacted.

    (Note this is not fired when the redaction happens before we receive the event).

      • (event, room, threadId?): void
      • Parameters

        • event: MatrixEvent

          The matrix redaction event

        • room: Room

          The room containing the redacted event

        • OptionalthreadId: string

          The thread containing the redacted event (before it was redacted)

        Returns void

  • Room.redactionCancelled: ((event: MatrixEvent, room: Room) => void)

    Fires when an event that was previously redacted isn't anymore. This happens when the redaction couldn't be sent and was subsequently cancelled by the user. Redactions have a local echo which is undone in this scenario.

      • (event, room): void
      • Parameters

        • event: MatrixEvent

          The matrix redaction event that was cancelled.

        • room: Room

          The room containing the unredacted event

        Returns void

  • Room.Summary: ((summary: IRoomSummary) => void)

    Fires when a new room summary is returned by /sync.

    See https://spec.matrix.org/v1.8/client-server-api/#_matrixclientv3sync_roomsummary for full details

      • (summary): void
      • Parameters

        Returns void

  • Room.tags: ((event: MatrixEvent, room: Room) => void)

    Fires whenever a room's tags are updated.

    matrixClient.on("Room.tags", function(event, room){
    var newTags = event.getContent().tags;
    if (newTags["favourite"]) showStar(room);
    });
      • (event, room): void
      • Parameters

        • event: MatrixEvent

          The tags event

        • room: Room

          The room whose Room.tags was updated.

        Returns void

  • Room.TimelineRefresh: ((room: Room, eventTimelineSet: EventTimelineSet) => void)
  • Room.UnreadNotifications: ((unreadNotifications?: NotificationCount, threadId?: string) => void)
      • (unreadNotifications?, threadId?): void
      • Parameters

        Returns void

  • Thread.new: ((thread: Thread, toStartOfTimeline: boolean) => void)
      • (thread, toStartOfTimeline): void
      • Parameters

        • thread: Thread
        • toStartOfTimeline: boolean

        Returns void