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

  • 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());
    }
    });
  • 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

    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.

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

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

  • 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.OldStateUpdated: (room: Room, previousRoomState: RoomState, roomState: RoomState) => 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();
    });
  • 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).

  • 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.

  • 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

  • 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);
    });
  • Room.TimelineRefresh: (room: Room, eventTimelineSet: EventTimelineSet) => void
  • Room.UnreadNotifications: (unreadNotifications?: NotificationCount, threadId?: string) => void
  • Thread.new: (thread: Thread, toStartOfTimeline: boolean) => void