ol.trixnity.event

Accessors and predicates for normalized event maps.

This namespace provides convenience accessors over the normalized event shapes defined in ol.trixnity.schemas without exposing callers to raw bridge internals.

Use these helpers when consuming timeline events, notifications, or reply metadata from ol.trixnity.room, ol.trixnity.notification, and ol.trixnity.room.message.

type

(type event)

Returns the Matrix event type string from normalized event.


room-id

(room-id event)

Returns the Matrix room id string from normalized event.


event-id

(event-id event)

Returns the Matrix event id string from normalized event.


sender

(sender event)

Returns the sender user id string from normalized event.


sender-display-name

(sender-display-name event)

Returns the sender display name from normalized event, if present.


body

(body event)

Returns the normalized message body from event, if present.


key

(key event)

Returns the normalized reaction key or relation key from event, if present.


relates-to

(relates-to event)

Returns the normalized ::mx/relates-to map from event, if present.


relation-event-id

(relation-event-id event)

Returns the related event id from event reply or relation metadata, if present.


raw

(raw event)

Returns the upstream raw event object carried by normalized event, if present.


text?

(text? event)

Returns true when event is a Matrix room-message event.


reaction?

(reaction? event)

Returns true when event is a Matrix reaction event.