From f5a0be0a7b27279544e15770578f2bf830e343d2 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Wed, 12 Mar 2025 09:09:21 +0200 Subject: [PATCH] Add support for configuring Synapse's MSC4140 (Delayed Events) experimental feature This is required by Element Call. Ref: - https://github.com/element-hq/element-call/blob/93ae2aed9841e0b066d515c56bd4c122d2b591b2/docs/self-hosting.md#a-matrix-homeserver - https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/3562 --- roles/custom/matrix-synapse/defaults/main.yml | 14 ++++++++++++++ .../templates/synapse/homeserver.yaml.j2 | 7 +++++++ 2 files changed, 21 insertions(+) diff --git a/roles/custom/matrix-synapse/defaults/main.yml b/roles/custom/matrix-synapse/defaults/main.yml index 9a99d5cd1..113edb498 100644 --- a/roles/custom/matrix-synapse/defaults/main.yml +++ b/roles/custom/matrix-synapse/defaults/main.yml @@ -1261,6 +1261,20 @@ matrix_synapse_experimental_features_msc4108_enabled: false # Set this to false if you still want to disable to API for some reason. Note that doing so breaks Element X compatibility though. matrix_synapse_experimental_features_msc3266_enabled: true +# Controls whether to enable the "Delayed Events" experimental feature. +# Delayed events are required for proper call (Element Call) participation signalling. +# If disabled it is very likely that you end up with stuck calls in Matrix rooms. +# +# Related to `matrix_synapse_max_event_delay_duration` +# +# See https://github.com/matrix-org/matrix-spec-proposals/pull/4140 +matrix_synapse_experimental_features_msc4140_enabled: false + +# Controls the maximum allowed duration by which sent events can be delayed, as per MSC4140. +# +# See `matrix_synapse_experimental_features_msc4140_enabled`. +matrix_synapse_max_event_delay_duration: 24h + # Enable this to activate the REST auth password provider module. # See: https://github.com/ma1uta/matrix-synapse-rest-password-provider matrix_synapse_ext_password_provider_rest_auth_enabled: false diff --git a/roles/custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 b/roles/custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 index 4daff2fef..ebdf323d8 100644 --- a/roles/custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 +++ b/roles/custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 @@ -2987,5 +2987,12 @@ experimental_features: {% if matrix_synapse_experimental_features_msc4108_enabled %} msc4108_enabled: true {% endif %} + {% if matrix_synapse_experimental_features_msc4140_enabled %} + msc4140_enabled: true + {% endif %} + +{% if matrix_synapse_experimental_features_msc4140_enabled %} +max_event_delay_duration: {{ matrix_synapse_max_event_delay_duration | to_json }} +{% endif %} # vim:ft=yaml