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.


msgtype

(msgtype event)

Returns the Matrix room-message subtype from normalized 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.


url

(url event)

Returns the normalized MXC URI from event, if present.


encrypted-file

(encrypted-file event)

Returns the normalized encrypted-file map from event, if present.


file-name

(file-name event)

Returns the normalized file name from event, if present.


mime-type

(mime-type event)

Returns the normalized MIME type from event, if present.


size-bytes

(size-bytes event)

Returns the normalized byte size from event, if present.


duration

(duration event)

Returns the normalized java.time.Duration from event, if present.


height

(height event)

Returns the normalized media height from event, if present.


width

(width event)

Returns the normalized media width from event, if present.


thumbnail-url

(thumbnail-url event)

Returns the event-provided thumbnail MXC URI from event, if present.


thumbnail-encrypted-file

(thumbnail-encrypted-file event)

Returns the event-provided encrypted thumbnail map from 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.