Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
# older binary. The helper reads the floors from DESCRIPTION.
- name: Install Matrix development dependencies
env:
# mx.crypto 0.2.2.2, including Matrix v2 attachment primitives.
MX_CRYPTO_REF: "74980d6453b71bc6eac9639416e0ec96df971ba9"
# mx.crypto 0.3.0, the CRAN release with Matrix v2 attachment primitives.
MX_CRYPTO_REF: "2fc2d5e1c3716086a5f5a75342037882ed8e4440"
run: |
Rscript -e 'install.packages(c("curl", "jsonlite"))'
Rscript .github/install-matrix-deps.R
Expand Down
9 changes: 4 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: mx.client
Type: Package
Title: Stateful Matrix Client Helpers
Version: 0.2.1.4
Date: 2026-10-26
Version: 0.3.0
Date: 2026-11-10
Authors@R: c(
person("Troy", "Hernandez", role = c("aut", "cre"),
email = "troy@cornball.ai",
Expand All @@ -22,13 +22,12 @@ Depends:
R (>= 4.0)
Imports:
jsonlite,
mx.api (>= 0.3.1.1),
mx.api (>= 0.3.0.2),
stats,
tools,
utils
Suggests:
livekitr,
mx.crypto (>= 0.2.2.2),
mx.crypto (>= 0.3.0),
simplermarkdown,
tinytest
VignetteBuilder: simplermarkdown
Expand Down
10 changes: 0 additions & 10 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
# tinyrox says don't edit this manually, but it can't stop you!

export(mx_accept_invites)
export(mx_call_connect)
export(mx_call_handle)
export(mx_call_join)
export(mx_call_key_parse)
export(mx_call_key_plan)
export(mx_call_leave)
export(mx_call_members)
export(mx_call_poll)
export(mx_call_service_url)
export(mx_client_config_path)
export(mx_client_configure)
export(mx_client_from_config)
Expand Down Expand Up @@ -77,5 +68,4 @@ export(mx_upload_encrypted)
export(mx_verify_console)
export(mx_with_relogin)

S3method(print,mx_call)
S3method(print,mx_client_config)
80 changes: 31 additions & 49 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
# mx.client 0.2.1.4
# mx.client 0.3.0

- Add encrypted attachment upload and verified download helpers using
mx.crypto's Matrix v2 primitives. Uploads expose only ciphertext with a
generic filename; downloads verify integrity before replacing the destination.
- Refuse plaintext `mx_send_media()` uploads to encrypted rooms before
transferring any file. Callers retain ownership of their live crypto sessions
and send the returned attachment metadata through `mx_send_encrypted()`.
## Encrypted to-device events

# mx.client 0.2.1.3

* Fix: keep every inbound Olm session per peer, not just the latest. A
* New: `mx_send_to_device_encrypted()` and `mx_crypto_encrypt_to_device()`
send an Olm-encrypted to-device event of any type.
* `mx_crypto_process_sync()` returns decrypted Olm to-device events other
than room keys and verification messages in a new `to_device` element,
and keeps each decrypted room event's `type` and `content`.
* `mx_send_encrypted()` gains an `event_type` argument.

## Encrypted media

* New: `mx_upload_encrypted()` and `mx_download_encrypted()` use
mx.crypto's Matrix v2 attachment primitives. Uploads expose only
ciphertext with a generic filename; downloads verify integrity before
replacing the destination.
* `mx_send_media()` refuses a plaintext upload to an encrypted room before
transferring any file. Callers retain ownership of their live crypto
sessions and send the returned attachment metadata through
`mx_send_encrypted()`.

## Fixes

* `mx_set_displayname()` returns the client it used, invisibly, in place
of `TRUE`. After a relogin that is the refreshed client, so the caller
can keep the new token (#18). `?mx_with_relogin` now states that the
refreshed config is saved before the retry.
* Keep every inbound Olm session per peer, not just the latest. A
peer can open several Olm sessions to us over its lifetime and reply on
any of them; the single inbound slot per peer was overwritten by each
new session, so a message sent on a session we had replaced could not be
Expand All @@ -26,45 +43,10 @@
`create_inbound` error for a failed prekey, so a dropped message is
diagnosable instead of silent.

# mx.client 0.2.1.2

* Fix: make MatrixRTC call encryption keys actually work, found during
the first live FluffyChat-to-bot call (the bot heard only undecryptable
silence).
- `keys` is an array of `{index, key}`, not a single object;
`mx_call_key_content()` and `mx_call_key_parse()` treated it as one,
so real key events (parsed off the wire with `simplifyVector =
FALSE`) were dropped. The parser now reads the array and returns one
entry per key.
- FluffyChat / matrix-dart-sdk sends the key as an encrypted ROOM
event (top-level `device_id`), not to-device. `mx_crypto_process_sync()`
now keeps each decrypted room event's `type` and `content`,
`mx_call_handle()` reads call keys from `processed$events` as well as
`to_device`, and `mx_call_key_parse()` accepts the room-event shape
(top-level `device_id`, room taken from the event).
- `mx_call_send_key()` also posts the key as an encrypted room event so
FluffyChat can decrypt the bot; `mx_send_encrypted()` gained an
`event_type` argument.

# mx.client 0.2.1.1

## MatrixRTC calls

* New: `mx_call_join()`, `mx_call_handle()`, `mx_call_poll()`,
`mx_call_connect()` and `mx_call_leave()` run a MatrixRTC call over
LiveKit the way Element Call and FluffyChat do: a per-device
`org.matrix.msc3401.call.member` state event, a media token from the
LiveKit JWT service, and per-participant media keys exchanged as
Olm-encrypted `io.element.call.encryption_keys` to-device events, with
their key rotation policy. Media goes through the `livekitr` package
(Suggests). `mx_call_members()`, `mx_call_service_url()`,
`mx_call_key_parse()` and `mx_call_key_plan()` expose the pieces.
* New: `mx_send_to_device_encrypted()` and `mx_crypto_encrypt_to_device()`
send an Olm-encrypted to-device event of any type.
* `mx_crypto_process_sync()` returns decrypted Olm to-device events other
than room keys and verification messages in a new `to_device` element.
* Requires mx.api 0.3.1.1 for the OpenID, RTC transport, LiveKit token and
room-state endpoints.
## Dependencies

* Raise the optional mx.crypto floor to 0.3.0, which adds the attachment
primitives. Unencrypted client operations still work without mx.crypto.

# mx.client 0.2.1

Expand Down
Loading
Loading