diff --git a/src/api/router.rs b/src/api/router.rs index e8b24cfca..36469eb46 100644 --- a/src/api/router.rs +++ b/src/api/router.rs @@ -162,10 +162,6 @@ pub fn build(router: Router, state: State) -> Router { .ruma_route(&client::update_device_route) .ruma_route(&client::delete_device_route) .ruma_route(&client::delete_devices_route) - .ruma_route(&client::put_dehydrated_device_route) - .ruma_route(&client::delete_dehydrated_device_route) - .ruma_route(&client::get_dehydrated_device_route) - .ruma_route(&client::get_dehydrated_events_route) .ruma_route(&client::get_tags_route) .ruma_route(&client::update_tag_route) .ruma_route(&client::delete_tag_route) @@ -198,6 +194,13 @@ pub fn build(router: Router, state: State) -> Router { .route("/_continuwuity/server_version", get(client::continuwuity_server_version)) .ruma_route(&admin::rooms::ban::ban_room) .ruma_route(&admin::rooms::list::list_rooms); + if config.experiments.msc3814.is_enabled() { + router = router + .ruma_route(&client::put_dehydrated_device_route) + .ruma_route(&client::delete_dehydrated_device_route) + .ruma_route(&client::get_dehydrated_device_route) + .ruma_route(&client::get_dehydrated_events_route); + } if config.experiments.msc4560.is_enabled() { router = router.ruma_route(&client::get_stripped_state_route); } diff --git a/src/core/config/experiments.rs b/src/core/config/experiments.rs index c19b19ad0..f647ed889 100644 --- a/src/core/config/experiments.rs +++ b/src/core/config/experiments.rs @@ -24,6 +24,26 @@ pub struct Experiments { /// display: nested #[serde(default)] pub msc2815: Option, + /// MSC3814: Dehydrated devices with SSSS + /// + /// Enables server-side support for "dehydrated devices", which are + /// server-side devices (created by supporting clients) that can collect + /// encryption keys when there are no online devices, which supporting + /// clients can then "hydrate" to download any encryption keys that were + /// sent while they were offline. + /// + /// Important: this is NOT required to receive encrypted messages while you + /// are offline. Devices can still receive encrypted messages while they are + /// offline, but to share those keys with new devices, they have to be + /// online. Dehydrated devices work around this by providing a "shared" + /// device new sessions can bootstrap from, to receive keys from before they + /// logged in that haven't been uploaded to the server-side key backup yet. + /// + /// https://github.com/matrix-org/matrix-spec-proposals/pull/3814 + /// + /// default: false + #[serde(default)] + pub msc3814: SimpleExperiment, /// MSC4155: Invite filtering /// /// Provides advanced invite filtering rules for users, allowing complex