# ol.trixnity next A Clojure adapter for Trixnity, a Matrix SDK. ## ol.trixnity.client # ol.trixnity.client Matrix client lifecycle, sync control, and client-level state flows. ## Upstream Mapping This namespace maps to client-wide APIs on Trixnity’s `de.connect2x.trixnity.client.MatrixClient`. The public wrappers here cover: * opening or resuming a client with [`open`](#open) * sync lifecycle tasks such as [`start-sync`](#start-sync), [`await-running`](#await-running), [`stop-sync`](#stop-sync), and [`close`](#close) * synchronous `current-*` accessors paired with relieved Missionary flows for profile, server data, sync state, login state, and startup state Use [`ol.trixnity.repo`](api/ol-trixnity-repo.adoc) when you want the built-in sqlite4clj-backed repository setup, and [`ol.trixnity.room`](api/ol-trixnity-room.adoc), [`ol.trixnity.user`](api/ol-trixnity-user.adoc), [`ol.trixnity.notification`](api/ol-trixnity-notification.adoc), [`ol.trixnity.verification`](api/ol-trixnity-verification.adoc), and [`ol.trixnity.key`](api/ol-trixnity-key.adoc) for service-specific APIs. ## open ```clojure (open config) ``` Opens or resumes a `MatrixClient` using the built-in sqlite4clj-backed repository configuration. If `config` already contains a client under `::mx/client`, the returned task resolves to that client immediately. Supported config keys include: * `::mx/homeserver-url` * `::mx/user-id` * `::mx/password` * `::mx/device-name` optional initial Matrix device display name * `::mx/device-id` optional Matrix device id to request at login * `::mx/database-path` * `::mx/media-path` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/client.clj#L39-L60) --- ## start-sync ```clojure (start-sync client) ``` Starts sync for `client` and returns a Missionary task. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/client.clj#L62-L65) --- ## await-running ```clojure (await-running client) (await-running client opts) ``` Waits for `client` to reach `RUNNING`. Supported opts: `{::mx/timeout java.time.Duration}` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/client.clj#L67-L79) --- ## stop-sync ```clojure (stop-sync client) ``` Stops sync for `client` and returns a Missionary task. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/client.clj#L81-L84) --- ## close ```clojure (close client) ``` Closes `client` and tears down its bridge-owned coroutine scope. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/client.clj#L86-L89) --- ## current-user-id ```clojure (current-user-id client) ``` Returns the Matrix user id of `client` as a string. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/client.clj#L91-L94) --- ## current-sync-state ```clojure (current-sync-state client) ``` Returns the current sync state as a lower-case keyword. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/client.clj#L96-L99) --- ## current-profile ```clojure (current-profile client) ``` Returns the current normalized client profile. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/client.clj#L101-L104) --- ## profile ```clojure (profile client) ``` Returns a Missionary flow of the current normalized client profile. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/client.clj#L106-L110) --- ## current-server-data ```clojure (current-server-data client) ``` Returns the current normalized server data snapshot. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/client.clj#L112-L115) --- ## server-data ```clojure (server-data client) ``` Returns a Missionary flow of normalized server data snapshots. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/client.clj#L117-L121) --- ## sync-state ```clojure (sync-state client) ``` Returns a Missionary flow of the current sync state. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/client.clj#L123-L128) --- ## current-initial-sync-done ```clojure (current-initial-sync-done client) ``` Returns whether initial sync has completed. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/client.clj#L130-L133) --- ## initial-sync-done ```clojure (initial-sync-done client) ``` Returns a Missionary flow of initial-sync completion state. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/client.clj#L135-L139) --- ## current-login-state ```clojure (current-login-state client) ``` Returns the current login state as a lower-case keyword or nil. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/client.clj#L141-L144) --- ## login-state ```clojure (login-state client) ``` Returns a Missionary flow of lower-case login-state keywords or nil. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/client.clj#L146-L151) --- ## current-started ```clojure (current-started client) ``` Returns whether sync has been started for `client`. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/client.clj#L153-L156) --- ## started ```clojure (started client) ``` Returns a Missionary flow of `client` started state. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/client.clj#L158-L162) ## ol.trixnity.event # 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) ## ol.trixnity.internal.bridge # ol.trixnity.internal.bridge ## open-client ```clojure (open-client request on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L19-L20) --- ## start-sync ```clojure (start-sync client on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L22-L23) --- ## await-running ```clojure (await-running client timeout on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L25-L26) --- ## stop-sync ```clojure (stop-sync client on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L28-L29) --- ## close-client ```clojure (close-client client on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L31-L32) --- ## current-user-id ```clojure (current-user-id client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L34-L35) --- ## current-sync-state ```clojure (current-sync-state client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L37-L38) --- ## current-profile ```clojure (current-profile client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L40-L41) --- ## profile-flow ```clojure (profile-flow client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L43-L44) --- ## current-server-data ```clojure (current-server-data client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L46-L47) --- ## server-data-flow ```clojure (server-data-flow client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L49-L50) --- ## sync-state-flow ```clojure (sync-state-flow client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L52-L53) --- ## current-initial-sync-done ```clojure (current-initial-sync-done client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L55-L56) --- ## initial-sync-done-flow ```clojure (initial-sync-done-flow client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L58-L59) --- ## current-login-state ```clojure (current-login-state client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L61-L62) --- ## login-state-flow ```clojure (login-state-flow client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L64-L65) --- ## current-started ```clojure (current-started client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L67-L68) --- ## started-flow ```clojure (started-flow client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L70-L71) --- ## current-users-typing ```clojure (current-users-typing client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L73-L74) --- ## users-typing-flow ```clojure (users-typing-flow client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L76-L77) --- ## set-typing ```clojure (set-typing client room-id typing timeout on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L79-L80) --- ## create-room ```clojure (create-room client request on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L82-L83) --- ## invite-user ```clojure (invite-user client room-id user-id timeout on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L85-L86) --- ## kick-user ```clojure (kick-user client room-id user-id reason timeout on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L88-L89) --- ## ban-user ```clojure (ban-user client room-id user-id reason timeout on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L91-L92) --- ## unban-user ```clojure (unban-user client room-id user-id reason timeout on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L94-L95) --- ## create-space ```clojure (create-space client request timeout on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L97-L98) --- ## space-hierarchy ```clojure (space-hierarchy client space-id request timeout on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L100-L101) --- ## spaces ```clojure (spaces client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L103-L104) --- ## spaces-flat ```clojure (spaces-flat client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L106-L107) --- ## space-child ```clojure (space-child client space-id child-room-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L109-L110) --- ## space-children ```clojure (space-children client space-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L112-L113) --- ## space-parents ```clojure (space-parents client room-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L115-L116) --- ## set-space-child ```clojure (set-space-child client space-id child-room-id content timeout on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L118-L119) --- ## remove-space-child ```clojure (remove-space-child client space-id child-room-id timeout on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L121-L122) --- ## set-space-parent ```clojure (set-space-parent client room-id parent-space-id content timeout on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L124-L125) --- ## remove-space-parent ```clojure (remove-space-parent client room-id parent-space-id timeout on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L127-L128) --- ## join-room ```clojure (join-room client room-id-or-alias timeout on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L130-L131) --- ## leave-room ```clojure (leave-room client room-id reason timeout on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L133-L134) --- ## forget-room ```clojure (forget-room client room-id force on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L136-L137) --- ## send-message ```clojure (send-message client room-id message timeout on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L139-L140) --- ## send-reaction ```clojure (send-reaction client room-id event-id key timeout on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L142-L143) --- ## send-state-event ```clojure (send-state-event client room-id state-event timeout on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L145-L146) --- ## set-power-levels ```clojure (set-power-levels client room-id power-levels timeout on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L148-L149) --- ## redact-event ```clojure (redact-event client room-id event-id reason timeout on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L151-L152) --- ## cancel-send-message ```clojure (cancel-send-message client room-id transaction-id on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L154-L155) --- ## retry-send-message ```clojure (retry-send-message client room-id transaction-id on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L157-L158) --- ## room-by-id ```clojure (room-by-id client room-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L160-L161) --- ## rooms ```clojure (rooms client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L163-L164) --- ## rooms-flat ```clojure (rooms-flat client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L166-L167) --- ## account-data ```clojure (account-data client room-id event-content-class key) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L169-L170) --- ## state ```clojure (state client room-id event-content-class state-key) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L172-L173) --- ## power-levels ```clojure (power-levels client room-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L175-L176) --- ## all-state ```clojure (all-state client room-id event-content-class) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L178-L179) --- ## outbox ```clojure (outbox client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L181-L182) --- ## outbox-flat ```clojure (outbox-flat client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L184-L185) --- ## outbox-by-room ```clojure (outbox-by-room client room-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L187-L188) --- ## outbox-by-room-flat ```clojure (outbox-by-room-flat client room-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L190-L191) --- ## outbox-message ```clojure (outbox-message client room-id transaction-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L193-L194) --- ## fill-timeline-gaps ```clojure (fill-timeline-gaps client room-id event-id limit on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L196-L197) --- ## timeline-events-from-now-on ```clojure (timeline-events-from-now-on client decryption-timeout-ms sync-response-buffer-size) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L199-L204) --- ## response-timeline-events ```clojure (response-timeline-events client response decryption-timeout-ms) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L206-L207) --- ## prepare-upload-media ```clojure (prepare-upload-media client source-path mime-type on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L209-L210) --- ## upload-media ```clojure (upload-media client cache-uri keep-in-cache on-progress on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L212-L213) --- ## get-media ```clojure (get-media client uri on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L215-L216) --- ## get-encrypted-media ```clojure (get-encrypted-media client encrypted-file on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L218-L219) --- ## get-thumbnail ```clojure (get-thumbnail client uri width height method animated on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L221-L223) --- ## media-temporary-file ```clojure (media-temporary-file platform-media on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L225-L226) --- ## delete-media-temporary-file ```clojure (delete-media-temporary-file temporary-file) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L228-L229) --- ## timeline-event ```clojure (timeline-event client room-id event-id decryption-timeout-ms fetch-timeout-ms fetch-size allow-replace-content) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L231-L240) --- ## previous-timeline-event ```clojure (previous-timeline-event client timeline-event decryption-timeout-ms fetch-timeout-ms fetch-size allow-replace-content) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L242-L250) --- ## next-timeline-event ```clojure (next-timeline-event client timeline-event decryption-timeout-ms fetch-timeout-ms fetch-size allow-replace-content) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L252-L260) --- ## last-timeline-event ```clojure (last-timeline-event client room-id decryption-timeout-ms fetch-timeout-ms fetch-size allow-replace-content) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L262-L270) --- ## timeline-event-chain ```clojure (timeline-event-chain client room-id start-from direction decryption-timeout-ms fetch-timeout-ms fetch-size allow-replace-content min-size max-size) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L272-L284) --- ## last-timeline-events ```clojure (last-timeline-events client room-id decryption-timeout-ms fetch-timeout-ms fetch-size allow-replace-content min-size max-size) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L286-L296) --- ## timeline-events-list ```clojure (timeline-events-list client room-id start-from direction max-size min-size decryption-timeout-ms fetch-timeout-ms fetch-size allow-replace-content) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L298-L310) --- ## last-timeline-events-list ```clojure (last-timeline-events-list client room-id max-size min-size decryption-timeout-ms fetch-timeout-ms fetch-size allow-replace-content) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L312-L322) --- ## timeline-events-around ```clojure (timeline-events-around client room-id start-from max-size-before max-size-after decryption-timeout-ms fetch-timeout-ms fetch-size allow-replace-content) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L324-L335) --- ## timeline-event-relations ```clojure (timeline-event-relations client room-id event-id relation-type) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L337-L338) --- ## user-all ```clojure (user-all client room-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L340-L341) --- ## load-members ```clojure (load-members client room-id wait on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L343-L344) --- ## user-by-id ```clojure (user-by-id client room-id user-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L346-L347) --- ## user-all-receipts ```clojure (user-all-receipts client room-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L349-L350) --- ## user-receipts-by-id ```clojure (user-receipts-by-id client room-id user-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L352-L353) --- ## user-power-level ```clojure (user-power-level client room-id user-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L355-L356) --- ## can-kick-user ```clojure (can-kick-user client room-id user-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L358-L359) --- ## can-ban-user ```clojure (can-ban-user client room-id user-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L361-L362) --- ## can-unban-user ```clojure (can-unban-user client room-id user-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L364-L365) --- ## can-invite-user ```clojure (can-invite-user client room-id user-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L367-L368) --- ## can-invite ```clojure (can-invite client room-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L370-L371) --- ## can-redact-event ```clojure (can-redact-event client room-id event-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L373-L374) --- ## can-set-power-level-to-max ```clojure (can-set-power-level-to-max client room-id user-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L376-L377) --- ## can-send-event-by-class ```clojure (can-send-event-by-class client room-id event-content-class) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L379-L380) --- ## can-send-event-by-content ```clojure (can-send-event-by-content client room-id event-content) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L382-L383) --- ## user-presence ```clojure (user-presence client user-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L385-L386) --- ## user-account-data ```clojure (user-account-data client event-content-class key) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L388-L389) --- ## user-direct-chats ```clojure (user-direct-chats client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L391-L392) --- ## set-direct-chats ```clojure (set-direct-chats client mappings on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L394-L395) --- ## notification-all ```clojure (notification-all client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L397-L398) --- ## notification-all-flat ```clojure (notification-all-flat client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L400-L401) --- ## notification-by-id ```clojure (notification-by-id client id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L403-L404) --- ## notification-count ```clojure (notification-count client) (notification-count client room-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L406-L410) --- ## notification-unread ```clojure (notification-unread client room-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L412-L413) --- ## notification-mark-read ```clojure (notification-mark-read client room-id event-id on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L415-L416) --- ## notification-mark-unread ```clojure (notification-mark-unread client room-id on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L418-L419) --- ## notification-all-updates ```clojure (notification-all-updates client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L421-L422) --- ## notification-dismiss ```clojure (notification-dismiss client id on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L424-L425) --- ## notification-dismiss-all ```clojure (notification-dismiss-all client on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L427-L428) --- ## current-active-device-verification ```clojure (current-active-device-verification client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L430-L431) --- ## active-device-verification-flow ```clojure (active-device-verification-flow client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L433-L434) --- ## current-active-user-verifications ```clojure (current-active-user-verifications client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L436-L437) --- ## active-user-verifications-flow ```clojure (active-user-verifications-flow client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L439-L440) --- ## self-verification-methods ```clojure (self-verification-methods client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L442-L443) --- ## start-device-verification ```clojure (start-device-verification client user-id device-id on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L445-L446) --- ## start-user-verification ```clojure (start-user-verification client user-id on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L448-L449) --- ## get-active-user-verification ```clojure (get-active-user-verification client room-id event-id on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L451-L452) --- ## ready-verification ```clojure (ready-verification client verification-id on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L454-L455) --- ## start-sas-verification ```clojure (start-sas-verification client verification-id on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L457-L458) --- ## accept-sas-verification ```clojure (accept-sas-verification client verification-id on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L460-L461) --- ## accept-verification ```clojure (accept-verification client verification-id on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L463-L464) --- ## confirm-verification ```clojure (confirm-verification client verification-id on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L466-L467) --- ## no-match-verification ```clojure (no-match-verification client verification-id on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L469-L470) --- ## cancel-verification ```clojure (cancel-verification client verification-id reason on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L472-L473) --- ## current-bootstrap-running ```clojure (current-bootstrap-running client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L475-L476) --- ## bootstrap-running-flow ```clojure (bootstrap-running-flow client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L478-L479) --- ## bootstrap-cross-signing ```clojure (bootstrap-cross-signing client opts on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L481-L482) --- ## bootstrap-cross-signing-from-passphrase ```clojure (bootstrap-cross-signing-from-passphrase client passphrase opts on-success on-failure) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L484-L486) --- ## current-backup-version ```clojure (current-backup-version client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L488-L489) --- ## backup-version-flow ```clojure (backup-version-flow client) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L491-L492) --- ## device-trust-level ```clojure (device-trust-level client user-id device-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L494-L495) --- ## timeline-trust-level ```clojure (timeline-trust-level client room-id event-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L497-L498) --- ## user-trust-level ```clojure (user-trust-level client user-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L500-L501) --- ## device-keys-flow ```clojure (device-keys-flow client user-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L503-L504) --- ## cross-signing-keys-flow ```clojure (cross-signing-keys-flow client user-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal/bridge.clj#L506-L507) ## ol.trixnity.internal # ol.trixnity.internal ## observe-flow ```clojure (observe-flow client kotlin-flow) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal.clj#L17-L21) --- ## observe-keyed-flow-map ```clojure (observe-keyed-flow-map client kotlin-outer-flow) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal.clj#L23-L40) --- ## observe-flow-list ```clojure (observe-flow-list client kotlin-outer-flow) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal.clj#L42-L47) --- ## suspend-task ```clojure (suspend-task bridge-fn & args) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal.clj#L49-L52) --- ## duration->millis ```clojure (duration->millis duration) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/internal.clj#L54-L55) ## ol.trixnity.key # ol.trixnity.key Encryption-key state, backup state, and trust-level queries. ## Upstream Mapping This namespace maps to Trixnity’s `KeyService` and `KeyBackupService`. The public wrappers here cover: * current and flow-based backup bootstrap state * cross-signing bootstrap * current and flow-based backup-version observation * trust-level queries for users, devices, and timeline events * device-key and cross-signing-key lookup Use [`ol.trixnity.verification`](api/ol-trixnity-verification.adoc) for active verification workflows and [`ol.trixnity.room`](api/ol-trixnity-room.adoc) when you need room timeline events to pair with trust-level checks. ## current-bootstrap-running ```clojure (current-bootstrap-running client) ``` Returns whether cross-signing bootstrap is currently running. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/key.clj#L28-L31) --- ## bootstrap-running ```clojure (bootstrap-running client) ``` Returns a Missionary flow of cross-signing bootstrap state. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/key.clj#L33-L37) --- ## bootstrap-cross-signing! ```clojure (bootstrap-cross-signing! client) (bootstrap-cross-signing! client opts) ``` Bootstraps cross-signing for the current Matrix account. Returns a Missionary task. The task resolves to a normalized map with: * `::mx/kind` — `"success"`, `"uia-required"`, or `"uia-error"` * `::mx/recovery-key` — the recovery key generated by Trixnity * `::mx/uia` — a UIA snapshot with completed stages, flows, session, and error details By default this calls Trixnity’s `KeyService.bootstrapCrossSigning()`. If `opts` includes `::mx/password`, the bridge attempts to complete a password UIA step before returning. `::mx/user-id` can override the password UIA user identifier; otherwise the current client’s Matrix user id is used. `"uia-required"` and `"uia-error"` results do not expose Trixnity UIA objects. Inspect `::mx/uia` to decide which public UIA flow or error remains. Persist or display `::mx/recovery-key` securely; it is the user’s recovery key material for the new bootstrap. Be aware that upstream cross-signing bootstrap can replace existing cross-signing and key-backup state for the account. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/key.clj#L39-L65) --- ## bootstrap-cross-signing-from-passphrase! ```clojure (bootstrap-cross-signing-from-passphrase! client passphrase) (bootstrap-cross-signing-from-passphrase! client passphrase opts) ``` Bootstraps cross-signing with a secret-storage passphrase. Returns the same normalized Missionary task result as [`bootstrap-cross-signing!`](#bootstrap-cross-signing!), but calls Trixnity’s `KeyService.bootstrapCrossSigningFromPassphrase(passphrase)`. `passphrase` configures the generated secret storage; use `::mx/password` in `opts` for password-based UIA completion. Be aware that upstream cross-signing bootstrap can replace existing cross-signing and key-backup state for the account. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/key.clj#L67-L87) --- ## current-backup-version ```clojure (current-backup-version client) ``` Returns the current active room-key-backup version, or nil when unavailable. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/key.clj#L89-L92) --- ## backup-version ```clojure (backup-version client) ``` Returns a Missionary flow of the active room-key-backup version. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/key.clj#L94-L98) --- ## get-trust-level ```clojure (get-trust-level client user-id) (get-trust-level client user-id-or-room-id device-id-or-event-id) ``` Returns a Missionary flow of trust information. With two arguments, `user-id` resolves to the trust level of that user. With three arguments, the meaning depends on the first id: * a `@user:server` value resolves device trust for `device-id` * a `!room:server` value resolves the trust level for the device that sent the timeline `event-id` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/key.clj#L100-L122) --- ## get-device-keys ```clojure (get-device-keys client user-id) ``` Returns a Missionary flow of device keys for `user-id`. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/key.clj#L124-L128) --- ## get-cross-signing-keys ```clojure (get-cross-signing-keys client user-id) ``` Returns a Missionary flow of cross-signing keys for `user-id`. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/key.clj#L130-L134) ## ol.trixnity.media # ol.trixnity.media Generic media upload and download helpers built on top of Trixnity’s media service. Uploads happen in two steps: * [`prepare-upload`](#prepare-upload) stages local bytes in Trixnity’s media store and returns a prepared upload map containing an `upload://...` cache URI * [`upload`](#upload) uploads either a prepared upload map or a local path-like source and returns a handle exposing upload progress plus the final uploaded media * [`get-media`](#get-media), [`get-encrypted-media`](#get-encrypted-media), and [`get-thumbnail`](#get-thumbnail) download media as normalized handle maps carrying a JVM `InputStream` Download selection follows the normalized event data: * use [`get-media`](#get-media) for plain `::mx/url` attachment references * use [`get-encrypted-media`](#get-encrypted-media) for `::mx/encrypted-file` or `::mx/thumbnail-encrypted-file` * use [`get-media`](#get-media) or [`get-encrypted-media`](#get-encrypted-media) for event-provided thumbnail references already present on the event * use [`get-thumbnail`](#get-thumbnail) only when asking the homeserver to generate a new thumbnail for an MXC URI at explicit dimensions * use [`temporary-file`](#temporary-file) only when a filesystem path is required for an existing media handle The public shapes here stay normalized as namespaced keyword maps so callers do not need to work with Kotlin media APIs directly. Resolved download handles all share the same shape: ```clojure {::mx/input-stream ::mx/raw } ``` `::mx/input-stream` is the supported happy path. `::mx/raw` exists only so [`temporary-file`](#temporary-file) can compose on top of an already fetched handle. ## ->TemporaryMediaFile ```clojure (->TemporaryMediaFile path raw) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/media.clj#L147-L150) --- ## TemporaryMediaFile [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/media.clj#L147-L150) --- ## map->TemporaryMediaFile ```clojure (map->TemporaryMediaFile m) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/media.clj#L147-L150) --- ## prepare-upload ```clojure (prepare-upload client source) (prepare-upload client source opts) ``` Stages a local media source in Trixnity’s media store and returns a Missionary task of a prepared upload map. `source` may be a string path, `java.io.File`, or `java.nio.file.Path`. Supported opts: | | | | --- | --- | | key | description | | `::mx/file-name` | Optional logical file name stored in the returned metadata | | `::mx/mime-type` | Optional MIME type forwarded to upstream media upload preparation | [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/media.clj#L165-L190) --- ## upload ```clojure (upload client source) (upload client source opts) ``` Uploads a prepared upload map or local media source and returns a handle map. When `source` is path-like, this first stages the file through [`prepare-upload`](#prepare-upload) and then uploads the resulting cache URI. Return value: * `::mx/result` is a Missionary task that resolves to the uploaded media map * `::mx/progress` is a Missionary flow of normalized progress snapshots with `::mx/transferred` and optional `::mx/total` This intentionally replaces the previous task-only return contract so one `upload` call can drive both progress observation and the final upload result from the same underlying operation. Supported opts: | key | description |-----|------------- | `::mx/file-name` | Optional logical file name when `source` is path-like | | `::mx/mime-type` | Optional MIME type when `source` is path-like | | `::mx/keep-in-cache` | Keep the staged media in the local cache after upload, defaults to `true` | [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/media.clj#L192-L250) --- ## get-media ```clojure (get-media client uri) ``` Downloads plain media identified by `uri`. Returns a Missionary task of a normalized media handle: * `::mx/input-stream`, the primary public readable stream * `::mx/raw`, an opaque upstream media value used only for composition with [`temporary-file`](#temporary-file) `uri` should be an MXC URI such as `mxc://example.org/abc`. Use this for event fields that already carry a plain media reference, such as `::mx/url` or `::mx/thumbnail-url`. Example: ```clojure (m/sp (let [handle (m/? (get-media client (::mx/url ev)))] (slurp (::mx/input-stream handle)))) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/media.clj#L252-L280) --- ## get-encrypted-media ```clojure (get-encrypted-media client encrypted-file) ``` Downloads encrypted media from normalized `encrypted-file` metadata. `encrypted-file` must be the normalized encrypted-file map exposed on events under `::mx/encrypted-file` or `::mx/thumbnail-encrypted-file`. Returns the same normalized media-handle shape as [`get-media`](#get-media), with `::mx/input-stream` as the public happy path and `::mx/raw` kept opaque for [`temporary-file`](#temporary-file) composition. Example: ```clojure (m/sp (let [handle (m/? (get-encrypted-media client (::mx/encrypted-file ev)))] (slurp (::mx/input-stream handle)))) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/media.clj#L282-L307) --- ## get-thumbnail ```clojure (get-thumbnail client uri width height) (get-thumbnail client uri width height opts) ``` Downloads a homeserver-generated thumbnail for `uri`. This mirrors upstream Trixnity `getThumbnail`: it asks the homeserver to generate a thumbnail for an MXC URI using explicit dimensions. It does not read event-provided thumbnail references already present on an event. For those, use [`get-media`](#get-media) or [`get-encrypted-media`](#get-encrypted-media) with `::mx/thumbnail-url` or `::mx/thumbnail-encrypted-file`. Returns the same normalized media-handle shape as [`get-media`](#get-media). Supported opts: | key | description |-----|------------- | `::mx/method` | Thumbnail resize method, either `:crop` or `:scale` | | `::mx/animated` | Request animated thumbnails when upstream supports them | Example: ```clojure (m/sp (let [handle (m/? (get-thumbnail client (::mx/url ev) 320 200 {::mx/method :scale}))] (slurp (::mx/input-stream handle)))) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/media.clj#L309-L354) --- ## temporary-file ```clojure (temporary-file media) ``` Creates a temporary file from `media`. `media` may be either a resolved media handle or a media-handle task returned by [`get-media`](#get-media), [`get-encrypted-media`](#get-encrypted-media), or [`get-thumbnail`](#get-thumbnail). Returns a Missionary task of a closeable [`TemporaryMediaFile`](#temporarymediafile) record. The record exposes `:path` directly as a slurpable string path and should usually be used with `with-open`. Treat `::mx/raw` on media handles as opaque; it exists only so this helper can compose with already-fetched media. This is an opt-in JVM convenience for integrations that need a filesystem path. If the underlying media handle cannot produce a temporary file, the task fails with an exception from the bridge layer. Example: ```clojure (m/sp (with-open [tmp (m/? (temporary-file (get-media client (::mx/url ev))))] (slurp (:path tmp)))) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/media.clj#L356-L395) ## ol.trixnity.notification # 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) ## ol.trixnity.repo.common # ol.trixnity.repo.common ## db ```clojure (db handle) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L51-L53) --- ## json ```clojure (json handle) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L55-L57) --- ## writer-pool ```clojure (writer-pool handle) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L59-L61) --- ## reader-pool ```clojure (reader-pool handle) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L63-L65) --- ## borrow-reader-conn! ```clojure (borrow-reader-conn! handle) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L67-L69) --- ## borrow-writer-conn! ```clojure (borrow-writer-conn! handle) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L71-L73) --- ## release-reader-conn! ```clojure (release-reader-conn! handle conn) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L75-L78) --- ## release-writer-conn! ```clojure (release-writer-conn! handle conn) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L80-L83) --- ## begin-deferred! ```clojure (begin-deferred! conn) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L85-L88) --- ## begin-immediate! ```clojure (begin-immediate! conn) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L90-L93) --- ## commit! ```clojure (commit! conn) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L95-L98) --- ## rollback! ```clojure (rollback! conn) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L100-L103) --- ## current-read-conn ```clojure (current-read-conn) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L105-L107) --- ## current-write-conn ```clojure (current-write-conn) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L109-L111) --- ## q-read ```clojure (q-read handle query) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L113-L118) --- ## q-write ```clojure (q-write handle query) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L120-L124) --- ## open! ```clojure (open! path json) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L126-L128) --- ## ensure-schema! ```clojure (ensure-schema! handle) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L130-L134) --- ## encode-json ```clojure (encode-json json serializer value) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L136-L138) --- ## decode-json ```clojure (decode-json json serializer value) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L140-L142) --- ## first-row ```clojure (first-row rows) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L144-L147) --- ## maybe-rows ```clojure (maybe-rows rows) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L149-L151) --- ## in-placeholders ```clojure (in-placeholders n) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L153-L155) --- ## minimal-get ```clojure (minimal-get handle table repo-key serializer) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L157-L163) --- ## minimal-save! ```clojure (minimal-save! handle table repo-key payload) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L165-L172) --- ## minimal-delete! ```clojure (minimal-delete! handle table repo-key) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L174-L179) --- ## delete-all! ```clojure (delete-all! handle table) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L181-L185) --- ## full-get-all ```clojure (full-get-all handle table serializer) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L187-L192) --- ## room-id-str ```clojure (room-id-str room-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L194-L196) --- ## user-id-str ```clojure (user-id-str user-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L198-L200) --- ## event-id-str ```clojure (event-id-str event-id) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo/common.clj#L202-L204) ## ol.trixnity.repo # ol.trixnity.repo Built-in repository helpers for the sqlite4clj-backed repository setup. Most callers do not need to interact with the raw repository handle or the Kotlin bridge types directly. Use [`sqlite4clj-config`](#sqlite4clj-config) with [`ol.trixnity.client/open`](api/ol-trixnity-client.adoc#open). Advanced callers can still build a `MatrixClient` with some other repository implementation and pass that client to [`ol.trixnity.client/open`](api/ol-trixnity-client.adoc#open) via `::mx/client`. ## sqlite4clj-config ```clojure (sqlite4clj-config options) ``` Returns config entries for the built-in sqlite4clj repository and okio media store. Prefer the namespaced keys from [`ol.trixnity.schemas`](api/ol-trixnity-schemas.adoc). Plain keywords are still accepted here as a convenience when normalizing app config. Options: | | | | --- | --- | | key | description | | `::mx/database-path` | SQLite file path used by `ol.trixnity.repo` | | `::mx/media-path` | Directory used by the okio-backed media store | Example: ```clojure (m/? (client/open (merge {::mx/homeserver-url "https://matrix.example.org" ::mx/user-id "@bot:example.org" ::mx/password "secret"} (repo/sqlite4clj-config {::mx/database-path "./var/trixnity.sqlite" ::mx/media-path "./var/media"})))) ``` [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo.clj#L51-L78) --- ## open-handle! ```clojure (open-handle! path json) ``` Opens a low-level sqlite4clj repository handle for `path`. Most callers should prefer [`sqlite4clj-config`](#sqlite4clj-config) with [`ol.trixnity.client/open`](api/ol-trixnity-client.adoc#open). This is the lower-level escape hatch used by the built-in repository assembly. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo.clj#L80-L87) --- ## create-repositories ```clojure (create-repositories handle mappings) ``` Builds the repository map expected by the Kotlin bridge from `handle`. This is primarily a low-level integration seam for custom client assembly. Most callers should use [`sqlite4clj-config`](#sqlite4clj-config) instead of constructing this map directly. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo.clj#L898-L937) ## ol.trixnity.room.message # ol.trixnity.room.message Helpers for constructing normalized room message payloads. This namespace provides small builders for the message-spec maps accepted by [`ol.trixnity.room/send-message`](api/ol-trixnity-room.adoc#send-message). The helpers here cover the common message-spec cases: * [`text`](#text) builds a normalized text message payload * [`emote`](#emote) builds a normalized emote message payload * [`audio`](#audio), [`image`](#image), and [`file`](#file) build normalized attachment payloads * [`reply-to`](#reply-to) attaches reply metadata from a normalized event map Use [`ol.trixnity.event`](api/ol-trixnity-event.adoc) to inspect the events you are replying to. ## text ```clojure (text body) (text body opts) ``` Builds a text message-spec map understood by [`ol.trixnity.room/send-message`](api/ol-trixnity-room.adoc#send-message). [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room/message.clj#L54-L64) --- ## emote ```clojure (emote body) (emote body opts) ``` Builds an emote message-spec map understood by [`ol.trixnity.room/send-message`](api/ol-trixnity-room.adoc#send-message). [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room/message.clj#L66-L76) --- ## audio ```clojure (audio source-path) (audio source-path opts) ``` Builds an audio message-spec map understood by [`ol.trixnity.room/send-message`](api/ol-trixnity-room.adoc#send-message). [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room/message.clj#L78-L83) --- ## image ```clojure (image source-path) (image source-path opts) ``` Builds an image message-spec map understood by [`ol.trixnity.room/send-message`](api/ol-trixnity-room.adoc#send-message). [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room/message.clj#L85-L90) --- ## file ```clojure (file source-path) (file source-path opts) ``` Builds a file message-spec map understood by [`ol.trixnity.room/send-message`](api/ol-trixnity-room.adoc#send-message). [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room/message.clj#L92-L97) --- ## reply-to ```clojure (reply-to message ev) ``` Associates reply metadata from normalized event `ev` onto `message`. When `ev` already carries relation metadata, that relation is copied into the reply target so upstream threading semantics are preserved. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room/message.clj#L99-L111) ## ol.trixnity.room # ol.trixnity.room Room operations, state queries, and timeline traversal. ## Upstream Mapping This namespace maps primarily to Trixnity’s `RoomService` on `de.connect2x.trixnity.client.MatrixClient`. The public wrappers here cover three upstream groupings: * room mutations such as room creation, invites, messages, reactions, and supported room state events and redactions * room observation and state operations such as `getById`, `getAll`, `getAccountData`, `getState`, and `getOutbox` * room-scoped timeline lookup and traversal helpers exposed through the room service and its timeline helpers Use [`ol.trixnity.user`](api/ol-trixnity-user.adoc) for `UserService` APIs and [`ol.trixnity.notification`](api/ol-trixnity-notification.adoc), [`ol.trixnity.verification`](api/ol-trixnity-verification.adoc), and [`ol.trixnity.key`](api/ol-trixnity-key.adoc) for the other non-room service mappings. ## get-outbox === [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L30-L30) === ```clojure (get-outbox client) (get-outbox client room-id) (get-outbox client room-id transaction-id) ``` Returns Missionary flows over room outbox state. Arities: * `(get-outbox client)` returns all outbox entries as a list of inner flows * `(get-outbox client room-id)` scopes that list to one room * `(get-outbox client room-id transaction-id)` returns the single outbox entry flow for that transaction id, including attachment upload progress under `::mx/media-upload-progress` when available [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L487-L505) --- ## create-room ```clojure (create-room client opts) ``` Creates a room and returns a Missionary task that resolves to the new room id. Supported opts: | | | | --- | --- | | key | description | | `::mx/room-name` | Optional room display name. | | `::mx/topic` | Optional room topic. | | `::mx/invite` | Optional vector of Matrix user ids to invite during creation. | | `::mx/preset` | Optional preset keyword, one of `:private-chat`, `:public-chat`, or `:trusted-private-chat`. | | `::mx/is-direct` | Optional direct-message flag for invite membership events. | | `::mx/visibility` | Optional room-directory visibility, either `:private` or `:public`. | [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L64-L81) --- ## invite-user ```clojure (invite-user client room-id user-id) (invite-user client room-id user-id opts) ``` Invites `user-id` to `room-id` and returns a Missionary task. Supported opts: | key | description |-----|------------- | `::mx/timeout` | Maximum time to wait for the invite request | [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L83-L101) --- ## kick-user ```clojure (kick-user client room-id user-id) (kick-user client room-id user-id opts) ``` Kicks `user-id` from `room-id` and returns a Missionary task. Supported opts: | | | | --- | --- | | key | description | | `::mx/reason` | Optional Matrix kick reason passed through to Trixnity | | `::mx/timeout` | Maximum time to wait for the kick request | [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L103-L123) --- ## ban-user ```clojure (ban-user client room-id user-id) (ban-user client room-id user-id opts) ``` Bans `user-id` from `room-id` and returns a Missionary task. Supported opts: | | | | --- | --- | | key | description | | `::mx/reason` | Optional Matrix ban reason passed through to Trixnity | | `::mx/timeout` | Maximum time to wait for the ban request | [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L125-L145) --- ## unban-user ```clojure (unban-user client room-id user-id) (unban-user client room-id user-id opts) ``` Unbans `user-id` from `room-id` and returns a Missionary task. Supported opts: | | | | --- | --- | | key | description | | `::mx/reason` | Optional Matrix unban reason passed through to Trixnity | | `::mx/timeout` | Maximum time to wait for the unban request | [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L147-L167) --- ## join-room ```clojure (join-room client room-id-or-alias) (join-room client room-id-or-alias opts) ``` Joins `room-id-or-alias` and returns a Missionary task. Supported opts: | key | description |-----|------------- | `::mx/timeout` | Maximum time to wait for the join request | [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L169-L185) --- ## leave-room ```clojure (leave-room client room-id) (leave-room client room-id opts) ``` Leaves `room-id` and returns a Missionary task. Supported opts: | | | | --- | --- | | key | description | | `::mx/reason` | Optional Matrix leave reason passed through to Trixnity | | `::mx/timeout` | Maximum time to wait for the leave request | [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L187-L205) --- ## forget-room ```clojure (forget-room client room-id) (forget-room client room-id opts) ``` Forgets `room-id` locally and returns a Missionary task. Upstream notes that this is intended for rooms in `LEAVE` membership. Supported opts: | key | description |-----|------------- | `::mx/force` | Force forgetting even when the usual upstream preconditions are not met | [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L207-L225) --- ## send-message ```clojure (send-message client room-id message) (send-message client room-id message opts) ``` Queues `message` for `room-id` and returns a Missionary task of a send handle. The task resolves to: * `::mx/transaction-id` for the queued outbox entry * `::mx/status`, a Missionary flow backed by [`get-outbox`](#get-outbox) for that transaction id The status flow may emit `nil` after the message leaves the outbox, which usually means it was echoed back by sync, cancelled, or otherwise removed. Supported opts: | key | description |-----|------------- | `::mx/timeout` | Maximum time to wait for the send operation | [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L227-L257) --- ## send-reaction ```clojure (send-reaction client room-id ev key) (send-reaction client room-id ev key opts) ``` Sends a reaction to event `ev` in `room-id` and returns a Missionary task. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L259-L273) --- ## send-state-event ```clojure (send-state-event client room-id state-event) (send-state-event client room-id state-event opts) ``` Sends a supported room state event map to `room-id`. Supported state-event payloads: * `{::mx/type "m.room.name", ::mx/name ...}` * `{::mx/type "m.room.topic", ::mx/topic ...}` * `{::mx/type "m.room.avatar", ::mx/url ...}` * `{::mx/type "m.room.power_levels", ...}` using the same content keys as [`set-power-levels`](#set-power-levels) * `{::mx/type "m.space.child", ::mx/state-key child-room-id, ::mx/via ...}` * `{::mx/type "m.space.parent", ::mx/state-key parent-space-id, ::mx/via ...}` `::mx/state-key` is optional for room state events that use the empty string state key. Space relation events require a room id state key. Supported opts: | key | description |-----|------------- | `::mx/timeout` | Maximum time to wait for the send operation | [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L275-L306) --- ## set-power-levels ```clojure (set-power-levels client room-id power-levels) (set-power-levels client room-id power-levels opts) ``` Sets the `m.room.power_levels` content for `room-id`. `power-levels` is a map with Matrix power-level fields using namespaced Clojure keys: | | | | --- | --- | | key | description | | `::mx/ban-level` | Level required to ban users | | `::mx/event-levels` | Map of event type string to required level | | `::mx/events-default-level` | Default level for message events | | `::mx/invite-level` | Level required to invite users | | `::mx/kick-level` | Level required to kick users | | `::mx/redact-level` | Level required to redact others' events | | `::mx/state-default-level` | Default level for state events | | `::mx/user-levels` | Map of user id string to user level | | `::mx/users-default-level` | Default level for users not in `::mx/user-levels` | | `::mx/notification-levels` | Map of notification key to required level | | `::mx/external-url` | Optional external URL attached to the state event content | Supported opts: | key | description |-----|------------- | `::mx/timeout` | Maximum time to wait for the send operation | [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L308-L343) --- ## redact-event ```clojure (redact-event client room-id event-id) (redact-event client room-id event-id opts) ``` Redacts `event-id` in `room-id` and returns a Missionary task of the redaction event id. Supported opts: | key | description |-----|------------- | `::mx/reason` | Optional redaction reason sent to the homeserver | | `::mx/timeout` | Maximum time to wait for the redact operation | [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L345-L365) --- ## cancel-send-message ```clojure (cancel-send-message client room-id transaction-id) ``` Cancels an outbox message identified by `transaction-id` and returns a Missionary task. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L367-L375) --- ## retry-send-message ```clojure (retry-send-message client room-id transaction-id) ``` Retries an outbox message identified by `transaction-id` and returns a Missionary task. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L377-L385) --- ## get-by-id ```clojure (get-by-id client room-id) ``` Returns a Missionary flow of the room for `room-id`, or nil when unavailable. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L387-L391) --- ## get-all ```clojure (get-all client) ``` Returns a Missionary flow of room flows keyed by room id. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L393-L396) --- ## get-all-flat ```clojure (get-all-flat client) ``` Returns a Missionary flow of flattened room snapshots. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L398-L401) --- ## current-users-typing ```clojure (current-users-typing client) ``` Returns the current typing-state snapshot keyed by room id. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L403-L406) --- ## users-typing ```clojure (users-typing client) ``` Returns a relieved Missionary flow of typing-state snapshots keyed by room id. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L408-L412) --- ## set-typing ```clojure (set-typing client room-id typing?) (set-typing client room-id typing? opts) ``` Sets the typing status for `room-id` and returns a Missionary task. Supported opts: | | | | --- | --- | | key | description | | `::mx/timeout` | How long the typing notification should remain active | [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L414-L432) --- ## get-power-levels ```clojure (get-power-levels client room-id) ``` Returns a Missionary flow of normalized `m.room.power_levels` content. The flow emits `nil` when no local power-level state is available for `room-id`. Emitted maps use the same content keys accepted by [`set-power-levels`](#set-power-levels). [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L434-L442) --- ## get-account-data ```clojure (get-account-data client room-id event-content-class) (get-account-data client room-id event-content-class key) ``` Returns a Missionary flow of room account-data content. When `key` is omitted, the empty-string key is used. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L444-L458) --- ## get-state ```clojure (get-state client room-id event-content-class) (get-state client room-id event-content-class state-key) ``` Returns a Missionary flow of room state for `event-content-class`. When `state-key` is omitted, the empty-string state key is used. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L460-L474) --- ## get-all-state ```clojure (get-all-state client room-id event-content-class) ``` Returns a Missionary flow of state-event flows keyed by state key. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L476-L485) --- ## get-outbox-flat ```clojure (get-outbox-flat client) (get-outbox-flat client room-id) ``` Returns flattened Missionary flows over room outbox state. With `room-id`, scopes the flattened outbox view to a single room. Flattened outbox snapshots also include `::mx/media-upload-progress` when an attachment-backed send is still uploading. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L507-L518) --- ## fill-timeline-gaps ```clojure (fill-timeline-gaps client room-id event-id) (fill-timeline-gaps client room-id event-id opts) ``` Fills timeline gaps around `event-id` in `room-id` and returns a Missionary task. Supported opts: | key | description |-----|------------- | `::mx/limit` | Maximum number of events to request while filling gaps (default `20`) | [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L520-L538) --- ## get-timeline-event ```clojure (get-timeline-event client room-id event-id) (get-timeline-event client room-id event-id opts) ``` Returns a Missionary flow of the timeline event for `event-id`. Upstream notes that this lookup may traverse locally stored events and fill remote gaps when the event is not available locally. Supported opts: | key | description |-----|------------- | `::mx/decryption-timeout` | Timeout used while decrypting timeline events | `::mx/fetch-timeout` | Timeout for remote fetches when the event is missing locally | `::mx/fetch-size` | Maximum number of events fetched from the server at once | `::mx/allow-replace-content` | Replace event content when an `m.replace` relation is present | [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L540-L570) --- ## get-previous-timeline-event ```clojure (get-previous-timeline-event client timeline-event) (get-previous-timeline-event client timeline-event opts) ``` Returns a Missionary flow of the previous timeline event relative to `timeline-event`. Returns nil when upstream cannot traverse backward from the supplied event. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L572-L588) --- ## get-next-timeline-event ```clojure (get-next-timeline-event client timeline-event) (get-next-timeline-event client timeline-event opts) ``` Returns a Missionary flow of the next timeline event relative to `timeline-event`. Returns nil when upstream cannot traverse forward from the supplied event. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L590-L606) --- ## get-last-timeline-event ```clojure (get-last-timeline-event client room-id) (get-last-timeline-event client room-id opts) ``` Returns a Missionary outer flow whose values are flows of the latest timeline event. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L608-L624) --- ## get-timeline-events ```clojure (get-timeline-events client response) (get-timeline-events client response opts) (get-timeline-events client room-id start-from direction) (get-timeline-events client room-id start-from direction opts) ``` Returns Missionary flows over timeline events. Arities: * `(get-timeline-events client response opts)` extracts timeline events from a sync `response` * `(get-timeline-events client room-id start-from direction opts)` traverses a room timeline from `start-from` in `:backwards` or `:forwards` The room traversal arity follows upstream behavior: it emits flows of events, may fetch missing events from the server, and can be bounded with `::mx/min-size` and `::mx/max-size`. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L626-L669) --- ## get-last-timeline-events ```clojure (get-last-timeline-events client room-id) (get-last-timeline-events client room-id opts) ``` Returns a Missionary flow whose values are flows of flows for the latest timeline events. This mirrors upstream’s nested-flow shape for continuously updated room-end traversal. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L671-L692) --- ## get-timeline-events-list ```clojure (get-timeline-events-list client room-id start-from direction max-size min-size) (get-timeline-events-list client room-id start-from direction max-size min-size opts) ``` Returns a Missionary flow of timeline-event lists starting from `start-from`. `max-size` and `min-size` bound the list-shaped traversal directly. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L694-L720) --- ## get-last-timeline-events-list ```clojure (get-last-timeline-events-list client room-id max-size min-size) (get-last-timeline-events-list client room-id max-size min-size opts) ``` Returns a Missionary flow of the latest timeline events as lists. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L722-L742) --- ## get-timeline-events-around ```clojure (get-timeline-events-around client room-id start-from max-size-before max-size-after) (get-timeline-events-around client room-id start-from max-size-before max-size-after opts) ``` Returns a Missionary flow of timeline-event lists centered around `start-from`. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L744-L766) --- ## get-timeline-events-from-now-on ```clojure (get-timeline-events-from-now-on client) (get-timeline-events-from-now-on client opts) ``` Returns a Missionary flow of timeline events received after subscription starts. Upstream notes that timeline gaps are not filled automatically for this live stream. Supported opts: | key | description |-----|------------- | `::mx/decryption-timeout` | Timeout used while decrypting live events | `::mx/sync-response-buffer-size` | Number of sync responses buffered while events are consumed | [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L768-L789) --- ## get-timeline-event-relations ```clojure (get-timeline-event-relations client room-id event-id relation-type) ``` Returns a Missionary flow of related timeline-event flows keyed by related event id. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/room.clj#L791-L799) ## ol.trixnity.schemas # ol.trixnity.schemas Malli schema registry for ol.trixnity Public namespaces validate arguments and normalize bridge-shaped data through the schemas defined here before crossing into [`ol.trixnity.internal.bridge`](api/ol-trixnity-internal-bridge.adoc). The registry includes: * public request and options maps for client, room, notification, and key operations * normalized event, profile, room, notification, verification, and trust data shapes * helper functions for building a registry and enforcing schema validation Most callers use these namespaced keys indirectly through the higher-level public APIs. Reach for this namespace directly when constructing config or payload maps by hand. ## schemas ```clojure (schemas _) ``` Returns the project Malli schema map for `opts`. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/schemas.clj#L73-L894) --- ## registry ```clojure (registry opts) ``` Builds a Malli registry containing the project schemas and default schemas. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/schemas.clj#L896-L901) --- ## schema-registry Default Malli registry used by public API validation. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/schemas.clj#L903-L905) --- ## validate! ```clojure (validate! schema-id data) (validate! registry schema-id data) ``` Validates `data` against `schema-id` and returns `data` on success. Throws `ExceptionInfo` with humanized Malli errors on validation failure. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/schemas.clj#L910-L924) ## ol.trixnity.space # ol.trixnity.space Matrix space creation, hierarchy, and relation helpers. Spaces are Matrix rooms with room type `m.space`. This namespace keeps the wrapper thin: optional values are passed only when callers provide them, and parent/child relation state is managed explicitly. Use [`ol.trixnity.room`](api/ol-trixnity-room.adoc) and [`ol.trixnity.user`](api/ol-trixnity-user.adoc) for generic room membership and power-level APIs. ## create-space ```clojure (create-space client) (create-space client opts) ``` Creates a Matrix space and returns a Missionary task resolving to its room id. The request uses upstream create-room defaults and only forces the Matrix room type to `m.space`. It does not add encryption or relation state. Supported opts: | | | | --- | --- | | key | description | | `::mx/room-name` | Optional space name | | `::mx/topic` | Optional space topic | | `::mx/invite` | Optional users to invite during creation | | `::mx/preset` | Optional upstream create-room preset | | `::mx/is-direct` | Optional direct-room flag passed through upstream | | `::mx/visibility` | Optional directory visibility | | `::mx/power-levels` | Optional upstream power-level content override | | `::mx/timeout` | Maximum time to wait for the create request | [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/space.clj#L37-L62) --- ## create-subspace ```clojure (create-subspace client parent-space-id opts) ``` Creates a Matrix space and adds it as a child of `parent-space-id`. This composes [`create-space`](#create-space) with [`set-child`](#set-child). It writes only the `m.space.child` event in `parent-space-id`; use [`set-parent`](#set-parent) separately if the child should also contain an `m.space.parent` event. Supported opts: | | | | --- | --- | | key | description | | `::mx/room-name` | Optional subspace name | | `::mx/topic` | Optional subspace topic | | `::mx/invite` | Optional users to invite during creation | | `::mx/preset` | Optional upstream create-room preset | | `::mx/is-direct` | Optional direct-room flag passed through upstream | | `::mx/visibility` | Optional directory visibility | | `::mx/power-levels` | Optional upstream power-level content override | | `::mx/via` | Required non-empty set of server names for the child relation | | `::mx/order` | Optional Matrix space child ordering string | | `::mx/suggested` | Optional suggested-child flag | | `::mx/external-url` | Optional external URL for the child relation | | `::mx/timeout` | Maximum time to wait for each request | [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/space.clj#L64-L101) --- ## hierarchy ```clojure (hierarchy client space-id) (hierarchy client space-id opts) ``` Returns one paginated hierarchy page for `space-id` as a Missionary task. Supported opts: | | | | --- | --- | | key | description | | `::mx/from` | Optional pagination token | | `::mx/limit` | Optional maximum rooms per page | | `::mx/max-depth` | Optional maximum traversal depth | | `::mx/suggested-only` | When true, include only suggested children | | `::mx/timeout` | Maximum time to wait for the hierarchy request | [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/space.clj#L103-L124) --- ## get-all ```clojure (get-all client) ``` Returns a Missionary flow of local space flows keyed by room id. This observes spaces already known to the client. It does not perform public room discovery. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/space.clj#L126-L132) --- ## get-all-flat ```clojure (get-all-flat client) ``` Returns a Missionary flow of local flattened space snapshots. This observes spaces already known to the client. It does not perform public room discovery. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/space.clj#L134-L140) --- ## get-children ```clojure (get-children client space-id) ``` Returns a Missionary flow of `m.space.child` state flows keyed by child room id. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/space.clj#L142-L146) --- ## get-child ```clojure (get-child client space-id child-room-id) ``` Returns a Missionary flow of the child relation for `child-room-id`. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/space.clj#L148-L153) --- ## get-parents ```clojure (get-parents client room-id) ``` Returns a Missionary flow of `m.space.parent` state flows keyed by parent space id. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/space.clj#L155-L159) --- ## set-child ```clojure (set-child client space-id child-room-id content) (set-child client space-id child-room-id content opts) ``` Writes an `m.space.child` event in `space-id` for `child-room-id`. The `content` map must include `::mx/via`. It may also include `::mx/order`, `::mx/suggested`, and `::mx/external-url`. Supported opts: | | | | --- | --- | | key | description | | `::mx/timeout` | Maximum time to wait for the state event request | [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/space.clj#L161-L184) --- ## remove-child ```clojure (remove-child client space-id child-room-id) (remove-child client space-id child-room-id opts) ``` Removes the child relation from `space-id` to `child-room-id`. This sends empty `m.space.child` content for the child state key, which makes the relation invalid under Matrix space rules. Supported opts: | | | | --- | --- | | key | description | | `::mx/timeout` | Maximum time to wait for the state event request | [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/space.clj#L186-L207) --- ## set-parent ```clojure (set-parent client room-id parent-space-id content) (set-parent client room-id parent-space-id content opts) ``` Writes an `m.space.parent` event in `room-id` for `parent-space-id`. The `content` map must include `::mx/via`. It may also include `::mx/canonical` and `::mx/external-url`. Supported opts: | | | | --- | --- | | key | description | | `::mx/timeout` | Maximum time to wait for the state event request | [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/space.clj#L209-L232) --- ## remove-parent ```clojure (remove-parent client room-id parent-space-id) (remove-parent client room-id parent-space-id opts) ``` Removes the parent relation from `room-id` to `parent-space-id`. This sends empty `m.space.parent` content for the parent state key, which makes the relation invalid under Matrix space rules. Supported opts: | | | | --- | --- | | key | description | | `::mx/timeout` | Maximum time to wait for the state event request | [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/space.clj#L234-L255) ## ol.trixnity.user # ol.trixnity.user Room user state, receipts, presence, and permission checks. ## Upstream Mapping This namespace wraps the user-oriented room APIs exposed by Trixnity’s `RoomService`. The public wrappers here cover: * room member lookup by id or as keyed flow maps * per-user receipt and power-level observation * permission checks for invites, bans, kicks, redactions, power changes, and sending events * user presence and global account-data queries Use [`ol.trixnity.room`](api/ol-trixnity-room.adoc) for room lifecycle and timeline access, and [`ol.trixnity.client`](api/ol-trixnity-client.adoc) for client-wide state. ## load-members ```clojure (load-members client room-id) (load-members client room-id opts) ``` Loads room members for `room-id` and returns a Missionary task. Supported opts: | key | description |-----|------------- | `::mx/wait` | When true, wait for the member load to finish before resolving the task (default `true`) | [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/user.clj#L26-L42) --- ## get-all ```clojure (get-all client room-id) ``` Returns a Missionary flow of room members keyed by user id. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/user.clj#L44-L48) --- ## get-by-id ```clojure (get-by-id client room-id user-id) ``` Returns a Missionary flow of the room member for `user-id`, or nil when unavailable. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/user.clj#L50-L55) --- ## get-all-receipts ```clojure (get-all-receipts client room-id) ``` Returns a Missionary flow of per-user receipt flows keyed by user id. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/user.clj#L57-L61) --- ## get-receipts-by-id ```clojure (get-receipts-by-id client room-id user-id) ``` Returns a Missionary flow of receipts for `user-id` in `room-id`. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/user.clj#L63-L68) --- ## get-power-level ```clojure (get-power-level client room-id user-id) ``` Returns a Missionary flow of the current power-level view for `user-id`. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/user.clj#L70-L75) --- ## can-kick-user ```clojure (can-kick-user client room-id user-id) ``` Returns a Missionary flow that reports whether the current client can kick `user-id`. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/user.clj#L77-L82) --- ## can-ban-user ```clojure (can-ban-user client room-id user-id) ``` Returns a Missionary flow that reports whether the current client can ban `user-id`. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/user.clj#L84-L89) --- ## can-unban-user ```clojure (can-unban-user client room-id user-id) ``` Returns a Missionary flow that reports whether the current client can unban `user-id`. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/user.clj#L91-L96) --- ## can-invite-user ```clojure (can-invite-user client room-id user-id) ``` Returns a Missionary flow that reports whether the current client can invite `user-id`. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/user.clj#L98-L103) --- ## can-invite ```clojure (can-invite client room-id) ``` Returns a Missionary flow that reports whether the current client can invite users to `room-id`. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/user.clj#L105-L109) --- ## can-redact-event ```clojure (can-redact-event client room-id event-id) ``` Returns a Missionary flow that reports whether the current client can redact `event-id`. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/user.clj#L111-L116) --- ## can-set-power-level-to-max ```clojure (can-set-power-level-to-max client room-id user-id) ``` Returns a Missionary flow of the maximum power level the current client may assign to `user-id`. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/user.clj#L118-L123) --- ## can-send-event ```clojure (can-send-event client room-id event-class-or-content) ``` Returns a Missionary flow that reports whether the current client can send an event. `event-class-or-content` may be either a room-event-content class or a concrete room-event-content instance. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/user.clj#L125-L142) --- ## get-presence ```clojure (get-presence client user-id) ``` Returns a Missionary flow of presence data for `user-id`. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/user.clj#L144-L148) --- ## get-account-data ```clojure (get-account-data client event-content-class) (get-account-data client event-content-class key) ``` Returns a Missionary flow of global account-data content. When `key` is omitted, the empty-string state key is used. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/user.clj#L150-L161) --- ## get-direct-chats ```clojure (get-direct-chats client) ``` Returns a Missionary flow of the current `m.direct` mapping. The emitted value is a map of Matrix user ids to sets of direct-room ids. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/user.clj#L163-L168) --- ## set-direct-chats ```clojure (set-direct-chats client mappings) ``` Writes the `m.direct` mapping and returns a Missionary task. `mappings` must be a map of Matrix user ids to sets of room ids. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/user.clj#L170-L178) ## ol.trixnity.verification # ol.trixnity.verification Verification state snapshots and active verification flows. ## Upstream Mapping This namespace maps to Trixnity’s `VerificationService`. The public wrappers here cover: * creating device and user verification requests * accepting requests, starting and accepting SAS, confirming or rejecting SAS, and cancelling active verifications * the current active device verification and its relieved flow * the current active user verifications and their relieved flow * self-verification method discovery Use [`ol.trixnity.key`](api/ol-trixnity-key.adoc) for trust and key-management APIs that often accompany verification workflows. ## current-active-device-verification ```clojure (current-active-device-verification client) ``` Returns the current active device verification, or nil when none is active. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/verification.clj#L30-L33) --- ## active-device-verification ```clojure (active-device-verification client) ``` Returns a relieved Missionary flow of the current active device verification. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/verification.clj#L35-L39) --- ## current-active-user-verifications ```clojure (current-active-user-verifications client) ``` Returns the current active user verifications as a vector. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/verification.clj#L41-L44) --- ## active-verification-snapshots ```clojure (active-verification-snapshots client) ``` Returns active device and user verification snapshots as a vector. Device verification, when present, appears first, followed by active user verifications in Trixnity order. Each snapshot contains a stable `::mx/verification-id` suitable for [`ready!`](#ready!), [`start-sas!`](#start-sas!), [`accept-sas!`](#accept-sas!), [`confirm!`](#confirm!), [`no-match!`](#no-match!), and [`cancel!`](#cancel!). [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/verification.clj#L46-L57) --- ## status ```clojure (status client) ``` Returns active verification snapshots. Alias for [`active-verification-snapshots`](#active-verification-snapshots). [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/verification.clj#L59-L64) --- ## active-user-verifications ```clojure (active-user-verifications client) ``` Returns a relieved Missionary flow of the current active user verifications. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/verification.clj#L66-L70) --- ## start-device-verification! ```clojure (start-device-verification! client user-id device-id) ``` Creates a device verification request and returns a Missionary task. `user-id` is the target Matrix user id. `device-id` is the target Matrix device id. The task resolves to a normalized active-verification snapshot. Maps to Trixnity `VerificationService.createDeviceVerificationRequest`. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/verification.clj#L72-L85) --- ## start-user-verification! ```clojure (start-user-verification! client user-id) ``` Creates a user verification request and returns a Missionary task. The task resolves to a normalized active-verification snapshot. Maps to Trixnity `VerificationService.createUserVerificationRequest`. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/verification.clj#L87-L94) --- ## get-active-user-verification! ```clojure (get-active-user-verification! client room-id event-id) ``` Gets or creates an active user verification for a room request event. `room-id` and `event-id` identify a Matrix verification request event. The task resolves to a normalized active-verification snapshot or nil. Maps to Trixnity `VerificationService.getActiveUserVerification`. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/verification.clj#L96-L108) --- ## ready! ```clojure (ready! client verification-id) ``` Sends `m.key.verification.ready` for an incoming verification request. `verification-id` must come from an active-verification snapshot. The task resolves to the updated snapshot. Maps to Trixnity `ActiveVerificationState.TheirRequest.ready`. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/verification.clj#L110-L118) --- ## start-sas! ```clojure (start-sas! client verification-id) ``` Starts SAS verification for a ready verification request. `verification-id` must come from an active-verification snapshot. The task resolves to the updated snapshot. Maps to Trixnity `ActiveVerificationState.Ready.start(VerificationMethod.Sas)`. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/verification.clj#L120-L128) --- ## accept-sas! ```clojure (accept-sas! client verification-id) ``` Accepts an incoming SAS start event. `verification-id` must come from an active-verification snapshot. The task resolves to the updated snapshot. Maps to Trixnity `ActiveSasVerificationState.TheirSasStart.accept`. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/verification.clj#L130-L138) --- ## accept! ```clojure (accept! client verification-id) ``` Accepts the current incoming verification step. `verification-id` must come from an active-verification snapshot. This maps to Trixnity’s available incoming action for the current state: request `ready` or SAS `accept`. Prefer [`ready!`](#ready!) or [`accept-sas!`](#accept-sas!) when the caller already knows the state. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/verification.clj#L140-L149) --- ## confirm! ```clojure (confirm! client verification-id) ``` Confirms that the SAS comparison matches. `verification-id` must come from an active-verification snapshot. The task resolves to the updated snapshot. Maps to Trixnity `ActiveSasVerificationState.ComparisonByUser.match`. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/verification.clj#L151-L159) --- ## no-match! ```clojure (no-match! client verification-id) ``` Rejects the SAS comparison as a mismatch. `verification-id` must come from an active-verification snapshot. The task resolves to the updated snapshot. Maps to Trixnity `ActiveSasVerificationState.ComparisonByUser.noMatch`. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/verification.clj#L161-L169) --- ## cancel! ```clojure (cancel! client verification-id) (cancel! client verification-id reason) ``` Cancels an active verification and returns a Missionary task. `verification-id` must come from an active-verification snapshot. With `reason`, passes that Matrix cancellation reason through to Trixnity. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/verification.clj#L171-L185) --- ## get-self-verification-methods ```clojure (get-self-verification-methods client) ``` Returns a Missionary flow of available self-verification methods. Upstream models this as a state machine that distinguishes unmet preconditions, no-cross-signing-yet, already-cross-signed, and available self-verification methods. [source,window=_blank](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/verification.clj#L187-L194) ## Changelog # Changelog All notable changes to this project will be documented in this file. This project uses [**Break Versioning**](https://www.taoensso.com/break-versioning). ## ++[++UNRELEASED++]++ ### Changed * Add public room power-level helpers for reading and writing `m.room.power_levels`. * Add public Matrix space helpers for space creation, local space listing, hierarchy inspection, and relation management. ## `v0.0.2` (2026-05-17) ### Added * Add sqlite4clj-backed sticky event repository support required by Trixnity 5.5.x. ### Changed * Upgrade Trixnity to 5.5.2, Ktor to 3.5.0, and kotlinx-coroutines to 1.11.0. * Replace the vendored coffi jar with a git dependency that works with Nix prep. ## `v0.0.1` (2026-03-12) Initial public release of `trixnity-clj`. This release establishes the first published Clojure wrapper around Trixnity, with Missionary-based task and flow interop plus the sqlite4clj-backed repository module. ## Upstream API Coverage # Upstream API Coverage This page tracks `trixnity-clj` coverage of Trixnity’s API. `Implemented` means there is a public wrapper under `ol.trixnity.*`. For upstream `StateFlow` members, the Clojure surface usually appears as a `current-*` accessor plus a Missionary flow. `Not yet` means there is no public wrapper today. ## Client ### MatrixClient | Status | Upstream member | `trixnity-clj` surface | Notes | | --- | --- | --- | --- | | Implemented | `userId` | `ol.trixnity.client/current-user-id` | Current snapshot only. | | Not yet | `deviceId` | - | No public wrapper. | | Not yet | `baseUrl` | - | No public wrapper. | | Not yet | `identityKey` | - | No public wrapper. | | Not yet | `signingKey` | - | No public wrapper. | | Not yet | `di` | - | No public wrapper. | | Not yet | `api` | - | Used internally by the bridge for some room endpoints, but not exposed publicly. | | Implemented | `profile` | `ol.trixnity.client/current-profile`, `ol.trixnity.client/profile` | Current snapshot plus relieved flow. | | Implemented | `serverData` | `ol.trixnity.client/current-server-data`, `ol.trixnity.client/server-data` | Current snapshot plus relieved flow. | | Implemented | `syncState` | `ol.trixnity.client/current-sync-state`, `ol.trixnity.client/sync-state` | Current snapshot plus relieved flow. | | Implemented | `initialSyncDone` | `ol.trixnity.client/current-initial-sync-done`, `ol.trixnity.client/initial-sync-done` | Current snapshot plus relieved flow. | | Implemented | `loginState` | `ol.trixnity.client/current-login-state`, `ol.trixnity.client/login-state` | Current snapshot plus relieved flow. | | Implemented | `started` | `ol.trixnity.client/current-started`, `ol.trixnity.client/started` | Current snapshot plus relieved flow. | | Not yet | `logout()` | - | No public wrapper. | | Not yet | `clearCache()` | - | No public wrapper. | | Not yet | `clearMediaCache()` | - | No public wrapper. | | Implemented | `startSync(...)` | `ol.trixnity.client/start-sync` | Uses upstream default presence. There is no public presence parameter. | | Not yet | `syncOnce(...)` | - | No public wrapper. | | Not yet | `syncOnce(..., runOnce)` | - | No public wrapper. | | Implemented | `stopSync()` | `ol.trixnity.client/stop-sync` | - | | Not yet | `cancelSync()` | - | No public wrapper. | | Not yet | `setProfileField(...)` | - | No public wrapper. | | Implemented | `closeSuspending()` | `ol.trixnity.client/close` | Public close path for the client lifecycle. | ### Additional Public APIs * `ol.trixnity.client/open` wraps client creation or resume around the built-in sqlite4clj repository configuration. * `ol.trixnity.client/await-running` waits for `syncState` to reach `RUNNING`. ## Room ### RoomService | Status | Upstream member | `trixnity-clj` surface | Notes | | --- | --- | --- | --- | | Implemented | `usersTyping` | `ol.trixnity.room/current-users-typing`, `ol.trixnity.room/users-typing` | Current snapshot plus relieved flow. | | Implemented | `fillTimelineGaps(roomId, eventId, limit)` | `ol.trixnity.room/fill-timeline-gaps` | - | | Implemented | `getTimelineEvent(roomId, eventId, config)` | `ol.trixnity.room/get-timeline-event` | Flow wrapper over one timeline event lookup. | | Implemented | `getPreviousTimelineEvent(timelineEvent, config)` | `ol.trixnity.room/get-previous-timeline-event` | - | | Implemented | `getNextTimelineEvent(timelineEvent, config)` | `ol.trixnity.room/get-next-timeline-event` | - | | Implemented | `getLastTimelineEvent(roomId, config)` | `ol.trixnity.room/get-last-timeline-event` | Preserves the upstream nested-flow shape. | | Implemented | `getTimelineEvents(roomId, startFrom, direction, config)` | `ol.trixnity.room/get-timeline-events`, `ol.trixnity.room/get-timeline-events-list` | `get-timeline-events-list` is a list-shaped convenience built on top of the same upstream timeline chain. | | Implemented | `getLastTimelineEvents(roomId, config)` | `ol.trixnity.room/get-last-timeline-events`, `ol.trixnity.room/get-last-timeline-events-list` | `get-last-timeline-events-list` is a list-shaped convenience over the same upstream room-end traversal. | | Implemented | `getTimelineEventsFromNowOn(...)` | `ol.trixnity.room/get-timeline-events-from-now-on` | Live timeline stream from the current sync position forward. | | Implemented | `getTimelineEvents(response, decryptionTimeout)` | `ol.trixnity.room/get-timeline-events` | Covered by the sync-response arity. | | Not yet | `getTimeline(...)` | - | The advanced mutable `Timeline` abstraction is not exposed yet. | | Implemented | `getTimelineEventRelations(roomId, eventId, relationType)` | `ol.trixnity.room/get-timeline-event-relations` | - | | Implemented | `sendMessage(roomId, wait, builder)` | `ol.trixnity.room/send-message`, `ol.trixnity.room/send-reaction` | `send-message` currently covers text messages and reply metadata. Reactions have a dedicated wrapper. | | Implemented | `cancelSendMessage(roomId, transactionId)` | `ol.trixnity.room/cancel-send-message` | - | | Implemented | `retrySendMessage(roomId, transactionId)` | `ol.trixnity.room/retry-send-message` | - | | Implemented | `getAll()` | `ol.trixnity.room/get-all`, `ol.trixnity.room/get-all-flat` | `get-all-flat` flattens the nested upstream flow map. | | Implemented | `getById(roomId)` | `ol.trixnity.room/get-by-id` | - | | Implemented | `forgetRoom(roomId, force)` | `ol.trixnity.room/forget-room` | - | | Implemented | `getAccountData(roomId, contentClass, key)` | `ol.trixnity.room/get-account-data` | - | | Implemented | `getOutbox()` | `ol.trixnity.room/get-outbox`, `ol.trixnity.room/get-outbox-flat` | `get-outbox-flat` flattens the nested upstream outbox flows. | | Implemented | `getOutbox(roomId)` | `ol.trixnity.room/get-outbox`, `ol.trixnity.room/get-outbox-flat` | Covered by room-scoped arities. | | Implemented | `getOutbox(roomId, transactionId)` | `ol.trixnity.room/get-outbox` | Covered by the transaction-id arity. | | Implemented | `getState(roomId, contentClass, stateKey)` | `ol.trixnity.room/get-state` | - | | Implemented | `getAllState(roomId, contentClass)` | `ol.trixnity.room/get-all-state` | - | ### Additional Public APIs | Status | Upstream API | `trixnity-clj` surface | Notes | | --- | --- | --- | --- | | Implemented | `MatrixClientServerApiClient.room.createRoom(...)` | `ol.trixnity.room/create-room` | Exposed directly through `client.api.room`, not through `RoomService`. | | Implemented | `MatrixClientServerApiClient.room.inviteUser(...)` | `ol.trixnity.room/invite-user` | Exposed directly through `client.api.room`, not through `RoomService`. | | Implemented | `MatrixClientServerApiClient.room.joinRoom(...)` | `ol.trixnity.room/join-room` | Exposed directly through `client.api.room`, not through `RoomService`. | | Implemented | `de.connect2x.trixnity.client.room.getTimelineEventsAround(...)` | `ol.trixnity.room/get-timeline-events-around` | Centers a list-shaped view around one timeline event. | ## Timeline | Status | Upstream member | `trixnity-clj` surface | Notes | | --- | --- | --- | --- | | Not yet | `state` | - | No public wrapper for `TimelineState`. | | Not yet | `init(...)` | - | No public wrapper. | | Not yet | `loadBefore(...)` | - | No public wrapper. | | Not yet | `loadAfter(...)` | - | No public wrapper. | | Not yet | `dropBefore(...)` | - | No public wrapper. | | Not yet | `dropAfter(...)` | - | No public wrapper. | ## UserService | Status | Upstream member | `trixnity-clj` surface | Notes | | --- | --- | --- | --- | | Implemented | `loadMembers(roomId, wait)` | `ol.trixnity.user/load-members` | - | | Implemented | `getAll(roomId)` | `ol.trixnity.user/get-all` | - | | Implemented | `getById(roomId, userId)` | `ol.trixnity.user/get-by-id` | - | | Implemented | `getAllReceipts(roomId)` | `ol.trixnity.user/get-all-receipts` | - | | Implemented | `getReceiptsById(roomId, userId)` | `ol.trixnity.user/get-receipts-by-id` | - | | Implemented | `getPowerLevel(roomId, userId)` | `ol.trixnity.user/get-power-level` | - | | Not yet | `getPowerLevel(roomId, createEvent, powerLevels)` | - | Pure helper overload is not wrapped. | | Implemented | `canKickUser(roomId, userId)` | `ol.trixnity.user/can-kick-user` | - | | Implemented | `canBanUser(roomId, userId)` | `ol.trixnity.user/can-ban-user` | - | | Implemented | `canUnbanUser(roomId, userId)` | `ol.trixnity.user/can-unban-user` | - | | Implemented | `canInviteUser(roomId, userId)` | `ol.trixnity.user/can-invite-user` | - | | Implemented | `canInvite(roomId)` | `ol.trixnity.user/can-invite` | - | | Implemented | `canRedactEvent(roomId, eventId)` | `ol.trixnity.user/can-redact-event` | - | | Implemented | `canSetPowerLevelToMax(roomId, userId)` | `ol.trixnity.user/can-set-power-level-to-max` | - | | Implemented | `canSendEvent(roomId, KClass)` | `ol.trixnity.user/can-send-event` | Covered by the class-taking arity. | | Implemented | `canSendEvent(roomId, RoomEventContent)` | `ol.trixnity.user/can-send-event` | Covered by the content-taking arity. | | Implemented | `getPresence(userId)` | `ol.trixnity.user/get-presence` | - | | Implemented | `getAccountData(contentClass, key)` | `ol.trixnity.user/get-account-data` | - | ## NotificationService | Status | Upstream member | `trixnity-clj` surface | Notes | | --- | --- | --- | --- | | Implemented | `getNotifications(decryptionTimeout, syncResponseBufferSize)` | `ol.trixnity.notification/get-notifications` | Deprecated upstream path. Still exposed as a deprecated Clojure wrapper. | | Implemented | `getNotifications(response, decryptionTimeout)` | `ol.trixnity.notification/get-notifications` | Covered by the response-taking deprecated arity. | | Implemented | `getAll()` | `ol.trixnity.notification/get-all`, `ol.trixnity.notification/get-all-flat` | `get-all-flat` flattens the nested upstream flows. | | Implemented | `getById(id)` | `ol.trixnity.notification/get-by-id` | - | | Implemented | `getCount()` | `ol.trixnity.notification/get-count` | Covered by the one-argument arity. | | Implemented | `getCount(roomId)` | `ol.trixnity.notification/get-count` | Covered by the room-scoped arity. | | Implemented | `isUnread(roomId)` | `ol.trixnity.notification/is-unread` | - | | Implemented | `dismiss(id)` | `ol.trixnity.notification/dismiss` | - | | Implemented | `dismissAll()` | `ol.trixnity.notification/dismiss-all` | - | | Implemented | `getAllUpdates()` | `ol.trixnity.notification/get-all-updates` | - | | Not yet | `onPush(roomId, eventId)` | - | No public wrapper. | | Not yet | `processPending()` | - | No public wrapper. | ## VerificationService | Status | Upstream member | `trixnity-clj` surface | Notes | | --- | --- | --- | --- | | Implemented | `activeDeviceVerification` | `ol.trixnity.verification/current-active-device-verification`, `ol.trixnity.verification/active-device-verification` | Current snapshot plus relieved flow. | | Implemented | `activeUserVerifications` | `ol.trixnity.verification/current-active-user-verifications`, `ol.trixnity.verification/active-user-verifications` | Current snapshot plus relieved flow. | | Not yet | `createDeviceVerificationRequest(...)` | - | No public wrapper. | | Not yet | `createUserVerificationRequest(...)` | - | No public wrapper. | | Implemented | `getSelfVerificationMethods()` | `ol.trixnity.verification/get-self-verification-methods` | - | | Not yet | `getActiveUserVerification(timelineEvent)` | - | No public wrapper. | | Not yet | `getActiveUserVerification(roomId, eventId)` | - | No public wrapper. | ## KeyService | Status | Upstream member | `trixnity-clj` surface | Notes | | --- | --- | --- | --- | | Implemented | `bootstrapRunning` | `ol.trixnity.key/current-bootstrap-running`, `ol.trixnity.key/bootstrap-running` | Current snapshot plus relieved flow. | | Not yet | `bootstrapCrossSigning(secretKey, secretKeyEvent)` | - | No public wrapper. | | Not yet | `bootstrapCrossSigning()` | - | No public wrapper. | | Not yet | `bootstrapCrossSigningFromPassphrase(passphrase)` | - | No public wrapper. | | Implemented | `getTrustLevel(userId, deviceId)` | `ol.trixnity.key/get-trust-level` | Covered by the three-argument arity when the first id is a user id. | | Implemented | `getTrustLevel(roomId, eventId)` | `ol.trixnity.key/get-trust-level` | Covered by the three-argument arity when the first id is a room id. | | Implemented | `getTrustLevel(userId)` | `ol.trixnity.key/get-trust-level` | Covered by the two-argument arity. | | Implemented | `getDeviceKeys(userId)` | `ol.trixnity.key/get-device-keys` | - | | Implemented | `getCrossSigningKeys(userId)` | `ol.trixnity.key/get-cross-signing-keys` | - | ## KeyBackupService | Status | Upstream member | `trixnity-clj` surface | Notes | | --- | --- | --- | --- | | Implemented | `version` | `ol.trixnity.key/current-backup-version`, `ol.trixnity.key/backup-version` | Current snapshot plus relieved flow. | | Not yet | `loadMegolmSession(roomId, sessionId)` | - | No public wrapper. | | Not yet | `keyBackupCanBeTrusted(version, recoveryKey)` | - | No public wrapper. | | Not yet | `bootstrapRoomKeyBackup(...)` | - | No public wrapper. | ## Examples # Examples This page collects focused examples for APIs that need more room than the README. ## Matrix Spaces ```clojure (ns my.spaces (:require [missionary.core :as m] [ol.trixnity.room :as room] [ol.trixnity.schemas :as mx] [ol.trixnity.space :as space]) (:import [java.time Duration])) (defn create-project-space [client] (m/? (space/create-space client {::mx/room-name "Project"}))) (defn create-project-docs-subspace [client project-space-id] (m/? (space/create-subspace client project-space-id {::mx/room-name "Project Docs" ::mx/via #{"matrix.example.org"}}))) (defn add-existing-room [client project-space-id room-id] (m/? (space/set-child client project-space-id room-id {::mx/via #{"matrix.example.org"} ::mx/order "a" ::mx/suggested true} {::mx/timeout (Duration/ofSeconds 5)}))) (defn set-canonical-parent [client room-id project-space-id] (m/? (space/set-parent client room-id project-space-id {::mx/via #{"matrix.example.org"} ::mx/canonical true}))) (defn remove-room-from-space [client project-space-id room-id] (m/? (space/remove-child client project-space-id room-id))) (defn remove-parent-link [client room-id project-space-id] (m/? (space/remove-parent client room-id project-space-id))) (defn read-first-hierarchy-page [client project-space-id] (m/? (space/hierarchy client project-space-id {::mx/limit 20 ::mx/max-depth 2 ::mx/suggested-only false}))) (defn invite-space-member [client project-space-id] ;; Spaces are rooms, so member actions use ol.trixnity.room directly. (m/? (room/invite-user client project-space-id "@alice:example.org"))) ``` ## ol.trixnity # ol.trixnity > A Clojure adapter for Trixnity, a Matrix SDK. Write Matrix apps and bots in Clojure. ![doc](https://img.shields.io/badge/doc-outskirtslabs-orange.svg) ![status: experimental](https://img.shields.io/badge/status-experimental-red.svg) ![alt=built with garnix](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fgarnix.io%2Fapi%2Fbadges%2Foutskirtslabs%2Ftrixnity-clj) [Trixnity](https://trixnity.connect2x.de/) is a Kotlin Multiplatform library for building Matrix applications. It covers the full Matrix client-server API surface, including room management, sync, and end-to-end encryption. Despite flying under the radar, Trixnity already powers a large chunk of Germany’s TI-Messenger healthcare infrastructure, reaching tens of millions of potential users. Trixnity targets the JVM, which means Clojure can call into it directly, but the interop is still rough. Nearly every interesting API is either a Kotlin suspend function or returns a `Flow` or `StateFlow`, so even basic client work quickly turns into coroutine plumbing: scopes, dispatchers, cancellation, and stream observation. The flow-heavy parts are especially awkward because they are long-lived Kotlin stream types, not something Clojure can consume idiomatically. So things like sync state, timeline updates, and other live observations need extra translation. Kotlin’s compiler also mangles names in the compiled bytecode, which makes direct interop harder when reading the upstream docs. `trixnity-clj` wraps Trixnity with a small Kotlin bridge and exposes the concurrency model using [Missionary](https://github.com/leonoel/missionary/). Kotlin suspend functions become Missionary tasks. Kotlin `Flow` and `StateFlow` surfaces become Missionary flows. `StateFlow` properties are exposed as a synchronous `current-*` getter plus a relieved Missionary flow. Project status: **[Experimental](https://docs.outskirtslabs.com/open-source-vital-signs#experimental)**. ## Installation `trixnity-clj` currently prepares its Kotlin bridge via `:deps/prep-lib`, so users must: * have `mvn` available on `PATH` * run `clojure -X:deps prep` before first use ```clojure ;; deps.edn {:deps {com.outskirtslabs/trixnity-clj {:git/url "https://github.com/outskirtslabs/trixnity-clj.git" :git/sha "2620932d74436b2f0b34ec577547993a7b9040da"}}} ``` ## Repository Backend In Trixnity, a repository module is the persistence backend for all the client state it needs to keep around: sync tokens, rooms, timelines, outbox entries, encryption keys, notifications, and the rest of the Matrix baggage. Upstream ships several of these across platforms. If you want durable storage on the JVM, the stock option is the [Exposed repository module](https://gitlab.com/trixnity/trixnity/-/tree/main/trixnity-client/trixnity-client-repository-exposed), which means JetBrains’s ORM Exposed layered on top of JDBC. Maybe that sparks joy for somebody. It does not spark joy for me. For the kind of bots and small clients I am building, running SQLite through JDBC makes write serialization harder than it should be, which means more `busy_timeout` pain. And god forbid anyone suggest dragging Hikari into that mess. So this library includes its own repository implementation backed by [sqlite4clj](https://github.com/andersmurphy/sqlite4clj), and that is the default setup. The storage layer is just plain SQLite, explicit SQL, and a lot less nonsense. Shout out to Anders Murphy for building [sqlite4clj](https://github.com/andersmurphy/sqlite4clj), and making the SQLite story in Clojure 100% less deranged. ## Example Usage Use [`ol.trixnity.repo`](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/repo.clj) to configure the built-in sqlite4clj repository, then open a client with [`ol.trixnity.client/open`](https://github.com/outskirtslabs/trixnity-clj/blob/main/src/clj/ol/trixnity/client.clj): ```clojure (ns my.bot (:require [missionary.core :as m] [ol.trixnity.client :as client] [ol.trixnity.event :as event] [ol.trixnity.repo :as repo] [ol.trixnity.room :as room] [ol.trixnity.room.message :as msg] [ol.trixnity.schemas :as mx]) (:import [java.time Duration])) (defn run-bot [] (let [client (m/? (client/open (merge {::mx/homeserver-url "https://matrix.example.org" ::mx/user-id "@bot:example.org" ::mx/password "secret"} (repo/sqlite4clj-config {:database-path "./var/trixnity.sqlite" :media-path "./var/media"}))))] (m/? (client/start-sync client)) (m/? (client/await-running client {::mx/timeout (Duration/ofSeconds 30)})) (future (m/? (m/reduce (fn [_ ev] (when (event/text? ev) (let [{::mx/keys [transaction-id status]} (m/? (room/send-message client (event/room-id ev) (-> (msg/text "pong") (msg/reply-to ev)) {::mx/timeout (Duration/ofSeconds 5)}))] (println "Queued reply with transaction id:" transaction-id) (future (m/? (m/reduce (fn [_ outbox-snapshot] (when-let [progress (::mx/media-upload-progress outbox-snapshot)] (println "Attachment upload progress:" progress)) nil) nil status))))) nil) nil (room/get-timeline-events-from-now-on client {::mx/decryption-timeout (Duration/ofSeconds 8)})))) {:client client})) ``` If you want a different repository implementation, construct a `MatrixClient` yourself and pass it to `client/open` as `::mx/client`. For more focused examples, including Matrix space administration, see [Examples](https://docs.outskirtslabs.com/ol.trixnity/next/examples). ## Documentation * [Docs](https://docs.outskirtslabs.com/ol.trixnity/next/) * [API Reference](https://docs.outskirtslabs.com/ol.trixnity/next/api) * [Support via GitHub Issues](https://github.com/outskirtslabs/trixnity-clj/issues) ## Examples Several examples are available in [examples](examples/): * [basic-bot](examples/basic-bot/) - A minimal end-to-end bot that opens a client, starts sync, joins invited rooms, and replies to live timeline events. ## License Copyright (C) 2026 Casey Link Distributed under the [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) just like Trixnity itself. ## Security policy # Security policy ## Advisories All security advisories for `trixnity-clj` will be posted [on GitHub](https://github.com/outskirtslabs/trixnity-clj/security/advisories). ## Reporting a vulnerability Please report possible security vulnerabilities [via GitHub](https://github.com/outskirtslabs/trixnity-clj/security/advisories), or by emailing me at `casey@outskirtslabs.com`. You may encrypt email with [my public PGP key](https://casey.link/pgp.asc). For the organization-wide security policy, see [Outskirts Labs Security Policy](https://docs.outskirtslabs.com/security-policy). Thank you! [Casey Link](https://casey.link)