Type alias RoomEventHandlerMap

RoomEventHandlerMap: {
    Poll.new: ((poll) => void);
    Room.CurrentStateUpdated: ((room, previousRoomState, roomState) => void);
    Room.OldStateUpdated: ((room, previousRoomState, roomState) => void);
    Room.Summary: ((summary) => void);
    Room.TimelineRefresh: ((room, eventTimelineSet) => void);
    Room.UnreadNotifications: ((unreadNotifications?, threadId?) => void);
    Room.accountData: ((event, room, lastEvent?) => void);
    Room.historyImportedWithinTimeline: ((markerEvent, room) => void);
    Room.localEchoUpdated: ((event, room, oldEventId?, oldStatus?) => void);
    Room.myMembership: ((room, membership, prevMembership?) => void);
    Room.name: ((room) => void);
    Room.receipt: ((event, room) => void);
    Room.redaction: ((event, room, threadId?) => void);
    Room.redactionCancelled: ((event, room) => void);
    Room.tags: ((event, room) => void);
    Thread.new: ((thread, toStartOfTimeline) => 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) => void)

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

      • (poll): void
      • Parameters

        • poll: Poll

          the new poll

        Returns void

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

        Returns void

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

        Returns void

  • Room.Summary: ((summary) => 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.TimelineRefresh: ((room, eventTimelineSet) => void)
  • Room.UnreadNotifications: ((unreadNotifications?, threadId?) => void)
      • (unreadNotifications?, threadId?): void
      • Parameters

        Returns void

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

    Fires whenever a room's account_data is updated.

    Example

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

        Returns void

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

        Returns void

  • Room.localEchoUpdated: ((event, room, oldEventId?, oldStatus?) => 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

        • Optional oldEventId: string

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

        • Optional oldStatus: EventStatus | null

          The previous event status.

        Returns void

  • Room.myMembership: ((room, membership, prevMembership?) => 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: string

          The new membership value

        • Optional prevMembership: string

          The previous membership value

        Returns void

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

    Fires whenever the name of a room is updated.

    Example

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

        • room: Room

          The room whose Room.name was updated.

        Returns void

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

    Fires whenever a receipt is received for a room

    Example

    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, room, threadId?) => 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

        • Optional threadId: string

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

        Returns void

  • Room.redactionCancelled: ((event, 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.tags: ((event, room) => void)

    Fires whenever a room's tags are updated.

    Example

    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

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

        • thread: Thread
        • toStartOfTimeline: boolean

        Returns void

Generated using TypeDoc