Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
707c9c4
Fix unnecessary qualification.
jevolk Aug 8, 2025
10096d5
Allow deprecated warnings.
jevolk Aug 8, 2025
ccb00ac
dont skip serialising default values for capabilities
x86pup Mar 19, 2024
1e00b57
client-api: Add cache-control header to media responses.
jevolk Apr 5, 2024
02cd9c4
add MSC3026 support (busy presence status)
x86pup Apr 5, 2024
1cfa144
client-api: Allow empty failures object in response to upload_signatu…
jevolk Apr 8, 2024
5cfdd95
skip serialising `identity_server` if None, and return empty string f…
x86pup Apr 29, 2024
0efde75
add custom room ID field to room creation request body
x86pup May 1, 2024
a7fdd10
feat: add undocumented `org.matrix.room.preview_urls` room state event
x86pup May 12, 2024
c7eaa54
add legacy Element Android/iOS hack for UIAA
x86pup Jun 6, 2024
bbd93bd
GATs are stable
jevolk Jun 25, 2024
bba0aba
fix incorrect MSC3266 room summary API endpoint
x86pup Jul 3, 2024
beb204a
make ruma-identifiers-validation a ruma feature
x86pup Jul 24, 2024
ba2cf5a
re-export js_int::Error
jevolk Aug 10, 2024
54456fb
zero-alloc zero-copy identifier deserialization and validation
jevolk Aug 11, 2024
222e0fc
add missing corp/cache-control headers to client authenticated media
jevolk Aug 14, 2024
dadfdda
estimate and reserve capacity in outgoing headers map
jevolk Aug 12, 2024
c4fb8c0
optimize for optional static response headers zero-copy zero-alloc
jevolk Aug 15, 2024
353dd4c
structured Mxc type
jevolk Aug 15, 2024
3b410a0
add missing Cow header in federation authenticated media
jevolk Aug 27, 2024
cafe72d
downgrade deprecation warns into debug_warns
jevolk Aug 28, 2024
01a5c52
accountdata: add an enum to allow returning both global and room acco…
morguldir Aug 30, 2024
0cffb4c
partial impl GET/PUT for MSC4133 and MSC4175
x86pup Sep 7, 2024
0c761f7
add DELETE impl of MSC4133 for MSC4175
x86pup Sep 7, 2024
7b2bb63
support generic KV pairs of MSC4133
x86pup Sep 10, 2024
bf3cdc1
Support `let sender: &UserId = value.get("sender").try_into()?;`
jevolk Oct 3, 2024
430da4e
impl Serialize for Mxc using Display/to_string() for now
jevolk Oct 8, 2024
0138dfd
impl Serialize for ContentDisposition
jevolk Oct 9, 2024
f26ae19
add required_keys util to signatures
jevolk Oct 12, 2024
97d28ff
add r0 endpoint to `PUT /_matrix/client/r0/room_keys/keys`
x86pup Oct 16, 2024
0e02e13
client-api: allow constructing ErrorBody::NotJson
CobaltCause Oct 2, 2024
8fc2c6f
Make to_cow_str() for event types public as at least some hedge again…
jevolk Oct 25, 2024
c4579b5
add unspecced r0 routes to more key endpoints
x86pup Oct 28, 2024
9098ad3
reserve outgoing request headers
jevolk Oct 30, 2024
567547e
add more missing unspecced r0 endpoints, fix silly upload_signatures …
x86pup Nov 19, 2024
0430e31
events: slightly rework benches
jevolk Nov 10, 2024
3e5af29
optimize PL deserialization
jevolk Nov 8, 2024
ba3e265
remove serde(flatten) in MSC4133 endpoints
x86pup Dec 15, 2024
ef55d6c
reserve the correct amount of headers
JadedBlueEyes Dec 17, 2024
379fdbd
various inlines
jevolk Nov 5, 2024
91fe606
refactor owned identifiers using SmallVec
jevolk Dec 27, 2024
a66f456
add errors for feature not implemented or disabled
jevolk Dec 24, 2024
9cf520a
various identifiers macro optimizations
jevolk Dec 28, 2024
61daec8
add capacity() and missing len() to Owned identifier interface
jevolk Jan 1, 2025
78080c6
identifiers: add clone from owned reference
jevolk Jan 22, 2025
c31464d
reduce several tracing spans to debug level
jevolk Jan 23, 2025
a79b896
fix doc lints
jevolk Feb 5, 2025
ed7b11b
dont fail req deserialisation over empty push response body
x86pup Feb 7, 2025
56dc41a
simple fix to allow `auth: {}` from element
dr-bonez Feb 14, 2025
47a17c2
move or_empty deserializer to ruma-common, add tests
morguldir Feb 16, 2025
962cb84
derive PartialEq for CrossSigningKey and identifiers::Signatures
morguldir Feb 16, 2025
6be6c27
better error reporting
dr-bonez Feb 17, 2025
7ec4282
nuke tf out of skip_serializing_if on power levels to improve client …
x86pup Mar 6, 2025
8c9acb3
default to an empty signatures, alias msc2732 fallback_keys, add rand…
x86pup Mar 9, 2025
b167833
fix threads include not defaulting properly
x86pup Mar 10, 2025
22b1af7
Check room_types in Filter::is_empty
gingershaped Mar 12, 2025
0657c81
allow no event_id in predecessor like synapse
x86pup Apr 2, 2025
a32f54c
fix ancient matrix-nio bot compat with e2ee reqs
x86pup Apr 3, 2025
0a77061
add msc4190 to appservice registration
x86pup Apr 3, 2025
ce147ea
add granular ACL content examination tools
jevolk Apr 3, 2025
bf754b1
Add fi.mau.room_id to the createRoom payload
timedoutuk Apr 19, 2025
d795b87
Remove msc2732 fallback key alias in upload key request body
timedoutuk Apr 23, 2025
2206dbb
Add more federation version properties.
jevolk Jun 12, 2025
011318e
Support org.matrix.login.jwt
jevolk Jun 18, 2025
81b6f5d
client-api: add rooms/initialSync support
jevolk Nov 12, 2024
04ea322
Derive Default for UiaaInfo and Presence.
jevolk Jun 29, 2025
836e4bd
impl IdentityServerBase64PublicKey PartialEq Base64.
jevolk Jun 27, 2025
bae9859
Add interfacing for restricted join rules.
jevolk Jun 29, 2025
dc4c36f
identifiers: Add from_iov()/from_parts() creating identifiers without…
jevolk Jul 11, 2025
35cf9a9
Fix report-room legacy version path.
jevolk Jul 14, 2025
a95023a
Use stable+compatible dedup for vec deserializers.
jevolk Jul 13, 2025
93a9729
Add missing event type conversions.
jevolk Aug 8, 2025
6c40177
Add missing Display for ErrorKind.
jevolk Aug 9, 2025
c85401f
Revert "client-api: add format query parameter for `get_state_event_f…
jevolk Aug 10, 2025
2e2097d
feat: query param to return the full room state event or just the con…
x86pup Feb 17, 2024
dfb3e61
Apply OwnedEventId::from_parts() to state-res RoomIdExt.
jevolk Aug 8, 2025
ea020c6
Add room_id to event_id convenience conversion.
jevolk Aug 8, 2025
4dc398c
Fix several missing conditional non_exhaustive.
jevolk Aug 11, 2025
95bcf47
Bless serde-flatten-response-body output diff.
jevolk Aug 26, 2025
24d345b
Remove unnecessary recursion_limit.
jevolk Aug 27, 2025
07fee6a
Add org.matrix.login.jwt AuthType.
jevolk Sep 8, 2025
8c5597e
Increase enum-variant-size-threshold lint.
jevolk Oct 22, 2025
0b5a975
Add `tags`, `not_tags`, and `spaces` fields to `sync_events::v5::requ…
jevolk Oct 4, 2025
b4df2c7
Add inline_bytes for SpaceChildOrder; fix borrow semantic in serializ…
jevolk Oct 6, 2025
eca064a
Optimize specific string types in sliding-sync request/response.
jevolk Oct 6, 2025
a75f978
client-api: Add `membership` and `lists` to `response::Room`. (MSC4186)
jevolk Oct 9, 2025
7d135bb
Optimize specific vector types in sliding-sync request/response.
jevolk Oct 9, 2025
90f84ab
client-api: Deduplicate RoomDetails and RoomSubscription into the sam…
jevolk Oct 9, 2025
d6934f4
Remove the erroneous query-spec from set_presence.
jevolk Oct 22, 2025
b858d34
Add opinionated value-oriented optimized string type for StateKey.
jevolk Oct 10, 2025
9f4ad22
Use value-oriented types for PushRule et al.
jevolk Oct 28, 2025
be88c97
Optimize types for Device metadata.
jevolk Nov 1, 2025
db4bf59
Optimize CanonicalJson property names.
jevolk Nov 2, 2025
4a3dd12
Serialize empty context events_before due to undefined error in eleme…
jevolk Nov 26, 2025
f8aa292
Add more efficient serializer for JsonObject out of slices of members.
jevolk Nov 28, 2025
db56187
Add SSO callback helper.
jevolk Dec 3, 2025
b7e7ad8
Implement MSC4361
dasha-uwu Dec 13, 2025
42b7f18
remove skip_serializing_if on join_rule PublicRoomsChunk
x86pup Dec 20, 2025
66aad73
room: Hold more data in the fallback variant of JoinRule
zecakeh Dec 12, 2025
cd96e6d
Implement MSC2815
dasha-uwu Jan 21, 2026
1ce82c1
Derive Default for MilliSecondsSinceUnixEpoch.
jevolk Jan 24, 2026
54f56d7
Add convenience to_duration() to MilliSecondsSinceUnixEpoch.
jevolk Jan 24, 2026
1311829
Add loginToken query param to sso flow.
jevolk Jan 24, 2026
069b3f6
Fix stable endpoints for custom profile fields.
jevolk Jan 30, 2026
0130f6a
Add missing r0 endpoint for legacy sso redirect.
jevolk Feb 5, 2026
495c96a
events: fix ACLs being case sensitive
velikopter Feb 10, 2026
e8038f1
Optimize case-insensitive comparisons.
jevolk Feb 12, 2026
2f53677
Replace version discovery Strings with SmallStrings.
jevolk Feb 13, 2026
3cb939f
Add function to iterate over aliases in RoomCanonicalAliasEventContent
dasha-uwu Feb 19, 2026
30d063c
remove skip_serializing_if on empty display_name and avatar_url for /…
x86pup Feb 15, 2026
d4b779a
Implement new MSC4143 endpoint
dasha-uwu Mar 25, 2026
8564227
Use OwnedServerName instead of String for list of servers.
jevolk Mar 25, 2026
46ab0cd
impl MSC4380
donjuanplatinum Mar 14, 2026
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
1 change: 1 addition & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
enum-variant-size-threshold = 512
avoid-breaking-exported-api = false
disallowed-methods = [
# https://github.com/serde-rs/json/issues/160
Expand Down
22 changes: 22 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ serde = { version = "1.0.164", features = ["derive"] }
serde_html_form = "0.2.0"
serde_json = "1.0.87"
similar = "2.6.0"
smallstr = { version = "0.3", features = ["ffi", "serde", "std", "union"] }
smallvec = { version = "1.15", features = ["const_generics", "const_new", "serde", "union", "write"] }

thiserror = "2.0.0"
toml = { version = "0.9.6", default-features = false, features = ["parse", "serde"] }
tracing = { version = "0.1.37", default-features = false, features = ["std"] }
Expand All @@ -54,6 +57,7 @@ unexpected_cfgs = { level = "warn", check-cfg = [
unreachable_pub = "warn"
unused_import_braces = "warn"
unused_qualifications = "warn"
deprecated = "allow"

[workspace.lints.clippy]
branches_sharing_code = "warn"
Expand Down
9 changes: 8 additions & 1 deletion crates/ruma-appservice-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,14 @@ pub struct Registration {
/// Whether the application service wants to receive ephemeral data.
///
/// Defaults to `false`.
#[serde(default, skip_serializing_if = "ruma_common::serde::is_default")]
#[serde(default)]
pub receive_ephemeral: bool,

/// Whether the application service wants to do device management, as part of MSC4190.
///
/// Defaults to `false`
#[serde(default, rename = "io.element.msc4190")]
pub device_management: bool,
}

/// Initial set of fields of `Registration`.
Expand Down Expand Up @@ -168,6 +174,7 @@ impl From<RegistrationInit> for Registration {
rate_limited,
protocols,
receive_ephemeral: false,
device_management: false,
}
}
}
10 changes: 10 additions & 0 deletions crates/ruma-client-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Breaking changes:
- Allow specifying the event format for `state::get_state_event_for_key`, meaning the response may
either be `Raw<AnyStateEvent>` or `Raw<AnyStateEventContent>`, depending on the format specified
in the request.
- Use `StrippedState` instead of `AnyStrippedStateEvent`, to allow non-stripped events to be
represented for `sync_events`.
- `sync_events::v3::State` is now an enum, to prepare for the stabilization of MSC4222. The state
before the timeline, corresponding to the `state` field in the Matrix specification, is available
in the `Before` variant, and the struct representing its content was renamed to `StateEvents`.
Expand All @@ -47,9 +49,16 @@ Breaking changes:
should always be identical.
- Add `set_presence` field to `sync_events::v5::Request` as per MSC4186; specified identically
to the field appearing in prior sync versions.
- Add `tags`, `not_tags`, and `spaces` fields to `sync_events::v5::request::ListFilters` as
specified in MSC4186 `SlidingRoomFilter` properties.

Improvements:

- Add `M_INVITE_BLOCKED` candidate error code proposed by
[MSC4380](https://github.com/matrix-org/matrix-spec-proposals/pull/4380)
sharing an unstable prefix with the preceding
[MSC4155](https://github.com/matrix-org/matrix-spec-proposals/pull/4155).

- Added support for the sliding sync extension for thread subscriptions, as well as the
accompanying endpoint, both from experimental MSC4308.
- Added support for the experiment MSC4306 thread subscription endpoints.
Expand Down Expand Up @@ -210,6 +219,7 @@ Improvements:
- Allow constructing `error::ErrorBody::NotJson` outside of this crate.
- Add function for checking if a `Content-Type` is considered "safe" for `inline`
rendering, according to MSC2702 / Matrix 1.12.
- Allow constructing `error::ErrorBody::NotJson` outside of this crate.

Bug fixes:

Expand Down
5 changes: 5 additions & 0 deletions crates/ruma-client-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ compat-upload-signatures = []
unstable-msc2666 = ["ruma-common/unstable-msc2666"]
unstable-msc2448 = []
unstable-msc2654 = []
unstable-msc2815 = []
unstable-msc2967 = []
unstable-msc3488 = []
unstable-msc3814 = []
Expand All @@ -52,10 +53,12 @@ unstable-msc4140 = ["ruma-common/unstable-msc4140"]
unstable-msc4143 = []
unstable-msc4186 = ["ruma-common/unstable-msc4186"]
unstable-msc4191 = []
unstable-msc4195 = ["unstable-msc4143"]
unstable-msc4222 = []
# Thread subscription support.
unstable-msc4306 = []
unstable-msc4308 = []
unstable-msc4380 = ["ruma-common/unstable-msc4380", "ruma-events/unstable-msc4380"]

[dependencies]
as_variant = { workspace = true }
Expand All @@ -71,6 +74,8 @@ ruma-events = { workspace = true }
serde = { workspace = true }
serde_html_form = { workspace = true }
serde_json = { workspace = true }
smallstr = { workspace = true }
smallvec = { workspace = true }
thiserror = { workspace = true }
url = { workspace = true, features = ["serde"] }
web-time = { workspace = true }
Expand Down
36 changes: 30 additions & 6 deletions crates/ruma-client-api/src/authenticated_media/get_content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ pub mod v1 {
//!
//! [spec]: https://spec.matrix.org/latest/client-server-api/#get_matrixclientv1mediadownloadservernamemediaid

use std::time::Duration;
use std::{borrow::Cow, time::Duration};

use http::header::{CONTENT_DISPOSITION, CONTENT_TYPE};
use http::header::{CACHE_CONTROL, CONTENT_DISPOSITION, CONTENT_TYPE};
use ruma_common::{
api::{request, response, Metadata},
http_headers::ContentDisposition,
metadata, IdParseError, MxcUri, OwnedServerName,
metadata, IdParseError, Mxc, MxcUri, OwnedServerName,
};

use crate::http_headers::CROSS_ORIGIN_RESOURCE_POLICY;

const METADATA: Metadata = metadata! {
method: GET,
rate_limited: true,
Expand Down Expand Up @@ -59,12 +61,32 @@ pub mod v1 {

/// The content type of the file that was previously uploaded.
#[ruma_api(header = CONTENT_TYPE)]
pub content_type: Option<String>,
pub content_type: Option<Cow<'static, str>>,

/// The value of the `Content-Disposition` HTTP header, possibly containing the name of the
/// file that was previously uploaded.
#[ruma_api(header = CONTENT_DISPOSITION)]
pub content_disposition: Option<ContentDisposition>,

/// The value of the `Cross-Origin-Resource-Policy` HTTP header.
///
/// See [MDN] for the syntax.
///
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Resource-Policy#syntax
///
/// TODO: make this use Cow static str's
#[ruma_api(header = CROSS_ORIGIN_RESOURCE_POLICY)]
pub cross_origin_resource_policy: Option<Cow<'static, str>>,

/// The value of the `Cache-Control` HTTP header.
///
/// See [MDN] for the syntax.
///
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#syntax
///
/// TODO: make this use Cow static str's
#[ruma_api(header = CACHE_CONTROL)]
pub cache_control: Option<Cow<'static, str>>,
}

impl Request {
Expand All @@ -79,7 +101,7 @@ pub mod v1 {

/// Creates a new `Request` with the given URI.
pub fn from_uri(uri: &MxcUri) -> Result<Self, IdParseError> {
let (server_name, media_id) = uri.parts()?;
let Mxc { server_name, media_id, .. } = uri.parts()?;

Ok(Self::new(media_id.to_owned(), server_name.to_owned()))
}
Expand All @@ -89,13 +111,15 @@ pub mod v1 {
/// Creates a new `Response` with the given file contents.
pub fn new(
file: Vec<u8>,
content_type: String,
content_type: Cow<'static, str>,
content_disposition: ContentDisposition,
) -> Self {
Self {
file,
content_type: Some(content_type),
content_disposition: Some(content_disposition),
cross_origin_resource_policy: None,
cache_control: None,
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ pub mod v1 {
//!
//! [spec]: https://spec.matrix.org/latest/client-server-api/#get_matrixclientv1mediadownloadservernamemediaidfilename

use std::time::Duration;
use std::{borrow::Cow, time::Duration};

use http::header::{CONTENT_DISPOSITION, CONTENT_TYPE};
use http::header::{CACHE_CONTROL, CONTENT_DISPOSITION, CONTENT_TYPE};
use ruma_common::{
api::{request, response, Metadata},
http_headers::ContentDisposition,
metadata, IdParseError, MxcUri, OwnedServerName,
metadata, IdParseError, Mxc, MxcUri, OwnedServerName,
};

use crate::http_headers::CROSS_ORIGIN_RESOURCE_POLICY;

const METADATA: Metadata = metadata! {
method: GET,
rate_limited: true,
Expand Down Expand Up @@ -63,12 +65,32 @@ pub mod v1 {

/// The content type of the file that was previously uploaded.
#[ruma_api(header = CONTENT_TYPE)]
pub content_type: Option<String>,
pub content_type: Option<Cow<'static, str>>,

/// The value of the `Content-Disposition` HTTP header, possibly containing the name of the
/// file that was previously uploaded.
#[ruma_api(header = CONTENT_DISPOSITION)]
pub content_disposition: Option<ContentDisposition>,

/// The value of the `Cross-Origin-Resource-Policy` HTTP header.
///
/// See [MDN] for the syntax.
///
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Resource-Policy#syntax
///
/// TODO: make this use Cow static str's
#[ruma_api(header = CROSS_ORIGIN_RESOURCE_POLICY)]
pub cross_origin_resource_policy: Option<Cow<'static, str>>,

/// The value of the `Cache-Control` HTTP header.
///
/// See [MDN] for the syntax.
///
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#syntax
///
/// TODO: make this use Cow static str's
#[ruma_api(header = CACHE_CONTROL)]
pub cache_control: Option<Cow<'static, str>>,
}

impl Request {
Expand All @@ -84,7 +106,7 @@ pub mod v1 {

/// Creates a new `Request` with the given URI and filename.
pub fn from_uri(uri: &MxcUri, filename: String) -> Result<Self, IdParseError> {
let (server_name, media_id) = uri.parts()?;
let Mxc { server_name, media_id, .. } = uri.parts()?;

Ok(Self::new(media_id.to_owned(), server_name.to_owned(), filename))
}
Expand All @@ -94,13 +116,15 @@ pub mod v1 {
/// Creates a new `Response` with the given file.
pub fn new(
file: Vec<u8>,
content_type: String,
content_type: Cow<'static, str>,
content_disposition: ContentDisposition,
) -> Self {
Self {
file,
content_type: Some(content_type),
content_disposition: Some(content_disposition),
cross_origin_resource_policy: None,
cache_control: None,
}
}
}
Expand Down
Loading