# ol.trixnity.notification

Notification snapshots and notification update flows.

## Upstream Mapping

This namespace maps to Trixnity’s `NotificationService`.

The public wrappers here cover:

* observing the full notification set in keyed or flat shapes
* looking up individual notifications and unread counts
* consuming live notification updates

Use [`ol.trixnity.room`](api/ol-trixnity-room.adoc) for room timeline access and
[`ol.trixnity.client`](api/ol-trixnity-client.adoc) for client lifecycle.

## get-all

```clojure
(get-all client)
```

Returns a Missionary flow of the current notifications as a list of inner flows.

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

---

## get-all-flat

```clojure
(get-all-flat client)
```

Returns a Missionary flow of flattened notification snapshots.

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

---

## get-by-id

```clojure
(get-by-id client id)
```

Returns a Missionary flow of the notification with `id`, or nil when unavailable.

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

---

## get-count

```clojure
(get-count client)
(get-count client room-id)
```

Returns a Missionary flow of notification counts.

With one argument, returns the total count across all rooms.
With `room-id`, returns the count for that room.

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

---

## is-unread

```clojure
(is-unread client room-id)
```

Returns a Missionary flow that is true when `room-id` is considered unread.

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

---

## mark-read

```clojure
(mark-read client room-id event-id)
```

Marks `room-id` as read through `event-id` and returns a Missionary task.

This advances both the room’s read markers and clears explicit unread state.

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

---

## mark-unread

```clojure
(mark-unread client room-id)
```

Marks `room-id` as unread and returns a Missionary task.

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

---

## dismiss

```clojure
(dismiss client id)
```

Marks the notification with `id` as dismissed and returns a Missionary task.

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

---

## dismiss-all

```clojure
(dismiss-all client)
```

Dismisses all notifications and returns a Missionary task.

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

---

## get-all-updates

```clojure
(get-all-updates client)
```

Returns a Missionary flow of notification updates.

Upstream notes that this stream should not be buffered because consumed
updates are removed from the backing store as new values are requested.

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