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
Type Declaration
Section titled “Type Declaration”Poll.new
Section titled “Poll.new”Poll.new: (
poll) =>void
Fires when a new poll instance is added to the room state
Parameters
Section titled “Parameters”the new poll
Returns
Section titled “Returns”void
Room.accountData
Section titled “Room.accountData”Room.accountData: (
event,room,prevEvent?) =>void
Fires whenever a room’s account_data is updated.
Parameters
Section titled “Parameters”The account_data event
The room whose account_data was updated.
prevEvent?
Section titled “prevEvent?”The event being replaced by the new account data, if known.
Returns
Section titled “Returns”void
Example
Section titled “Example”digitalWorldClient.on("Room.accountData", function(event, room, oldEvent){ if (event.getType() === "m.room.colorscheme") { applyColorScheme(event.getContents()); }});Room.CurrentStateUpdated
Section titled “Room.CurrentStateUpdated”Room.CurrentStateUpdated: (
room,previousRoomState,roomState) =>void
Parameters
Section titled “Parameters”previousRoomState
Section titled “previousRoomState”roomState
Section titled “roomState”Returns
Section titled “Returns”void
Room.historyImportedWithinTimeline
Section titled “Room.historyImportedWithinTimeline”Room.historyImportedWithinTimeline: (
markerEvent,room) =>void
Parameters
Section titled “Parameters”markerEvent
Section titled “markerEvent”Returns
Section titled “Returns”void
Room.localEchoUpdated
Section titled “Room.localEchoUpdated”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.
Parameters
Section titled “Parameters”The event which has been updated
The room containing the redacted event
oldEventId?
Section titled “oldEventId?”string
The previous event id (the temporary event id, except when updating a successfully-sent event when its echo arrives)
oldStatus?
Section titled “oldStatus?”EventStatus | null
The previous event status.
Returns
Section titled “Returns”void
Room.myMembership
Section titled “Room.myMembership”Room.myMembership: (
room,membership,prevMembership?) =>void
Fires when the logged in user’s membership in the room is updated.
Parameters
Section titled “Parameters”The room in which the membership has been updated
membership
Section titled “membership”The new membership value
prevMembership?
Section titled “prevMembership?”The previous membership value
Returns
Section titled “Returns”void
Room.name
Section titled “Room.name”Room.name: (
room) =>void
Fires whenever the name of a room is updated.
Parameters
Section titled “Parameters”The room whose Room.name was updated.
Returns
Section titled “Returns”void
Example
Section titled “Example”digitalWorldClient.on("Room.name", function(room){ var newName = room.name;});Room.OldStateUpdated
Section titled “Room.OldStateUpdated”Room.OldStateUpdated: (
room,previousRoomState,roomState) =>void
Parameters
Section titled “Parameters”previousRoomState
Section titled “previousRoomState”roomState
Section titled “roomState”Returns
Section titled “Returns”void
Room.receipt
Section titled “Room.receipt”Room.receipt: (
event,room) =>void
Fires whenever a receipt is received for a room
Parameters
Section titled “Parameters”The receipt event
The room whose receipts was updated.
Returns
Section titled “Returns”void
Example
Section titled “Example”digitalWorldClient.on("Room.receipt", function(event, room){ var receiptContent = event.getContent();});Room.redaction
Section titled “Room.redaction”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).
Parameters
Section titled “Parameters”The redaction event
The room containing the redacted event
threadId?
Section titled “threadId?”string
The thread containing the redacted event (before it was redacted)
Returns
Section titled “Returns”void
Room.redactionCancelled
Section titled “Room.redactionCancelled”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.
Parameters
Section titled “Parameters”The redaction event that was cancelled.
The room containing the unredacted event
Returns
Section titled “Returns”void
Room.Summary
Section titled “Room.Summary”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
Parameters
Section titled “Parameters”summary
Section titled “summary”the room summary object
Returns
Section titled “Returns”void
Room.tags
Section titled “Room.tags”Room.tags: (
event,room) =>void
Fires whenever a room’s tags are updated.
Parameters
Section titled “Parameters”The tags event
The room whose Room.tags was updated.
Returns
Section titled “Returns”void
Example
Section titled “Example”digitalWorldClient.on("Room.tags", function(event, room){ var newTags = event.getContent().tags; if (newTags["favourite"]) showStar(room);});Room.TimelineRefresh
Section titled “Room.TimelineRefresh”Room.TimelineRefresh: (
room,eventTimelineSet) =>void
Parameters
Section titled “Parameters”eventTimelineSet
Section titled “eventTimelineSet”Returns
Section titled “Returns”void
Room.UnreadNotifications
Section titled “Room.UnreadNotifications”Room.UnreadNotifications: (
unreadNotifications?,threadId?) =>void
Parameters
Section titled “Parameters”unreadNotifications?
Section titled “unreadNotifications?”threadId?
Section titled “threadId?”string
Returns
Section titled “Returns”void
Thread.new
Section titled “Thread.new”Thread.new: (
thread,toStartOfTimeline) =>void
Parameters
Section titled “Parameters”thread
Section titled “thread”toStartOfTimeline
Section titled “toStartOfTimeline”boolean
Returns
Section titled “Returns”void