# 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`](api/ol-trixnity-schemas.adoc) without
exposing callers to raw bridge internals.

Use these helpers when consuming timeline events, notifications, or reply
metadata from [`ol.trixnity.room`](api/ol-trixnity-room.adoc), [`ol.trixnity.notification`](api/ol-trixnity-notification.adoc), and
[`ol.trixnity.room.message`](api/ol-trixnity-room-message.adoc).

## type

```clojure
(type event)
```

Returns the Matrix event type string from normalized `event`.

[source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/event.clj#L17-L20)

---

## room-id

```clojure
(room-id event)
```

Returns the Matrix room id string from normalized `event`.

[source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/event.clj#L22-L25)

---

## event-id

```clojure
(event-id event)
```

Returns the Matrix event id string from normalized `event`.

[source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/event.clj#L27-L30)

---

## sender

```clojure
(sender event)
```

Returns the sender user id string from normalized `event`.

[source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/event.clj#L32-L35)

---

## sender-display-name

```clojure
(sender-display-name event)
```

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

[source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/event.clj#L37-L40)

---

## body

```clojure
(body event)
```

Returns the normalized message body from `event`, if present.

[source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/event.clj#L42-L45)

---

## msgtype

```clojure
(msgtype event)
```

Returns the Matrix room-message subtype from normalized `event`, if present.

[source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/event.clj#L47-L50)

---

## key

```clojure
(key event)
```

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

[source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/event.clj#L52-L55)

---

## relates-to

```clojure
(relates-to event)
```

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

[source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/event.clj#L57-L60)

---

## relation-event-id

```clojure
(relation-event-id event)
```

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

[source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/event.clj#L62-L65)

---

## raw

```clojure
(raw event)
```

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

[source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/event.clj#L67-L70)

---

## url

```clojure
(url event)
```

Returns the normalized MXC URI from `event`, if present.

[source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/event.clj#L72-L75)

---

## encrypted-file

```clojure
(encrypted-file event)
```

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

[source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/event.clj#L77-L80)

---

## file-name

```clojure
(file-name event)
```

Returns the normalized file name from `event`, if present.

[source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/event.clj#L82-L85)

---

## mime-type

```clojure
(mime-type event)
```

Returns the normalized MIME type from `event`, if present.

[source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/event.clj#L87-L90)

---

## size-bytes

```clojure
(size-bytes event)
```

Returns the normalized byte size from `event`, if present.

[source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/event.clj#L92-L95)

---

## duration

```clojure
(duration event)
```

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

[source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/event.clj#L97-L100)

---

## height

```clojure
(height event)
```

Returns the normalized media height from `event`, if present.

[source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/event.clj#L102-L105)

---

## width

```clojure
(width event)
```

Returns the normalized media width from `event`, if present.

[source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/event.clj#L107-L110)

---

## thumbnail-url

```clojure
(thumbnail-url event)
```

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

[source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/event.clj#L112-L115)

---

## thumbnail-encrypted-file

```clojure
(thumbnail-encrypted-file event)
```

Returns the event-provided encrypted thumbnail map from `event`, if present.

[source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/event.clj#L117-L120)

---

## text?

```clojure
(text? event)
```

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

[source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/event.clj#L122-L125)

---

## reaction?

```clojure
(reaction? event)
```

Returns true when `event` is a Matrix reaction event.

[source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/event.clj#L127-L130)
