Skip to content

RoomEventHandlerMap

RoomEventHandlerMap = object & Pick<ThreadEventHandlerMap, Update | NewReply | Delete> & EventTimelineSetHandlerMap & Pick<DigitalWorldEventHandlerMap, BeforeRedaction> & Pick<RoomStickyEventsMap, Update> & Pick<RoomStateEventHandlerMap, Events | Members | NewMember | Update | Marker | New> & Pick<BeaconEventHandlerMap, Update | Destroy | LivenessChange>

Defined in: src/models/room.ts:184

Poll.new: (poll) => void

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

Poll

the new poll

void

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

Fires whenever a room’s account_data is updated.

DigitalWorldEvent

The account_data event

Room

The room whose account_data was updated.

DigitalWorldEvent

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

void

digitalWorldClient.on("Room.accountData", function(event, room, oldEvent){
if (event.getType() === "m.room.colorscheme") {
applyColorScheme(event.getContents());
}
});

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

Room

RoomState

RoomState

void

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

DigitalWorldEvent

Room

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 (DigitalWorldEvent.event) is replaced by the complete event from the hub, 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.

DigitalWorldEvent

The event which has been updated

Room

The room containing the redacted event

string

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

EventStatus | null

The previous event status.

void

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

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

Room

The room in which the membership has been updated

Membership

The new membership value

Membership

The previous membership value

void

Room.name: (room) => void

Fires whenever the name of a room is updated.

Room

The room whose Room.name was updated.

void

digitalWorldClient.on("Room.name", function(room){
var newName = room.name;
});

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

Room

RoomState

RoomState

void

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

Fires whenever a receipt is received for a room

DigitalWorldEvent

The receipt event

Room

The room whose receipts was updated.

void

digitalWorldClient.on("Room.receipt", function(event, room){
var receiptContent = event.getContent();
});

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

DigitalWorldEvent

The redaction event

Room

The room containing the redacted event

string

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

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.

DigitalWorldEvent

The redaction event that was cancelled.

Room

The room containing the unredacted event

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

IRoomSummary

the room summary object

void

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

Fires whenever a room’s tags are updated.

DigitalWorldEvent

The tags event

Room

The room whose Room.tags was updated.

void

digitalWorldClient.on("Room.tags", function(event, room){
var newTags = event.getContent().tags;
if (newTags["favourite"]) showStar(room);
});

Room.TimelineRefresh: (room, eventTimelineSet) => void

Room

EventTimelineSet

void

Room.UnreadNotifications: (unreadNotifications?, threadId?) => void

NotificationCount

string

void

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

Thread

boolean

void