From 6d1519e60f417a6716945f0ea04932648c8c6e6a Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Tue, 11 May 2021 08:31:02 -0400 Subject: [PATCH 1/4] Send the `m.room.create` stripped event with invites (support MSC1772). --- changelog.d/9915.feature | 2 +- changelog.d/9966.feature | 1 + synapse/config/api.py | 6 ++---- 3 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 changelog.d/9966.feature diff --git a/changelog.d/9915.feature b/changelog.d/9915.feature index 832916cb01af..e4c3e911420d 100644 --- a/changelog.d/9915.feature +++ b/changelog.d/9915.feature @@ -1 +1 @@ -Support stable identifiers from [MSC1772](https://github.com/matrix-org/matrix-doc/pull/1772). +Support [MSC1772](https://github.com/matrix-org/matrix-doc/pull/1772). diff --git a/changelog.d/9966.feature b/changelog.d/9966.feature new file mode 100644 index 000000000000..e4c3e911420d --- /dev/null +++ b/changelog.d/9966.feature @@ -0,0 +1 @@ +Support [MSC1772](https://github.com/matrix-org/matrix-doc/pull/1772). diff --git a/synapse/config/api.py b/synapse/config/api.py index 55c038c0c4ee..b18044f9822a 100644 --- a/synapse/config/api.py +++ b/synapse/config/api.py @@ -88,10 +88,6 @@ def _get_prejoin_state_types(self, config: JsonDict) -> Iterable[str]: if not room_prejoin_state_config.get("disable_default_event_types"): yield from _DEFAULT_PREJOIN_STATE_TYPES - if self.spaces_enabled: - # MSC1772 suggests adding m.room.create to the prejoin state - yield EventTypes.Create - yield from room_prejoin_state_config.get("additional_event_types", []) @@ -109,6 +105,8 @@ def _get_prejoin_state_types(self, config: JsonDict) -> Iterable[str]: EventTypes.RoomAvatar, EventTypes.RoomEncryption, EventTypes.Name, + # Per MSC1772. + EventTypes.Create, ] From cf6bc9be61a9aa059706ff68191cc3a87d2b424d Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Tue, 11 May 2021 08:50:47 -0400 Subject: [PATCH 2/4] Update the sample config. --- docs/sample_config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/sample_config.yaml b/docs/sample_config.yaml index f469d6e54f66..f8610cd096a4 100644 --- a/docs/sample_config.yaml +++ b/docs/sample_config.yaml @@ -1515,6 +1515,7 @@ room_prejoin_state: # - m.room.avatar # - m.room.encryption # - m.room.name + # - m.room.create # # Uncomment the following to disable these defaults (so that only the event # types listed in 'additional_event_types' are shared). Defaults to 'false'. From 074da2856e4bfbc6520bfb10dcb991c6f6c3ecd7 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Tue, 11 May 2021 09:23:18 -0400 Subject: [PATCH 3/4] Add upgrade notes and update changelog. --- UPGRADE.rst | 29 +++++++++++++++++++++++++++++ changelog.d/9915.feature | 2 +- changelog.d/9966.feature | 2 +- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/UPGRADE.rst b/UPGRADE.rst index e921e0c08a5f..aeb5af17b7c9 100644 --- a/UPGRADE.rst +++ b/UPGRADE.rst @@ -85,6 +85,35 @@ for example: wget https://packages.matrix.org/debian/pool/main/m/matrix-synapse-py3/matrix-synapse-py3_1.3.0+stretch1_amd64.deb dpkg -i matrix-synapse-py3_1.3.0+stretch1_amd64.deb +Upgrading to v1.34.0 +==================== + +`room_invite_state_types` configuration setting +----------------------------------------------- + +The ``room_invite_state_types`` configuration setting has been deprecated and +replaced with ``disable_default_event_types`` and ``additional_event_types``. + +If you have set ``room_invite_state_types`` to the default value you should simply +remove it from your configuration file. The default value used to be: + +.. code:: yaml + + room_invite_state_types: + - "m.room.join_rules" + - "m.room.canonical_alias" + - "m.room.avatar" + - "m.room.encryption" + - "m.room.name" + +If you have customised this value by adding addition state types, you should +remove ``room_invite_state_types`` and configure ``additional_event_types`` with +your customisations. + +If you have customised this value by removing state types, you should rename +``room_invite_state_types`` to ``additional_event_types``, and set +``disable_default_event_types`` to ``true`` + Upgrading to v1.33.0 ==================== diff --git a/changelog.d/9915.feature b/changelog.d/9915.feature index e4c3e911420d..7b81faabead1 100644 --- a/changelog.d/9915.feature +++ b/changelog.d/9915.feature @@ -1 +1 @@ -Support [MSC1772](https://github.com/matrix-org/matrix-doc/pull/1772). +Support stable identifiers for [MSC1772](https://github.com/matrix-org/matrix-doc/pull/1772) Spaces. `m.space.child` events will now be taken into account when populating the experimental spaces summary response. Please see `UPGRADE.rst` if you have customised `room_invite_state_types` in your configuration. \ No newline at end of file diff --git a/changelog.d/9966.feature b/changelog.d/9966.feature index e4c3e911420d..7b81faabead1 100644 --- a/changelog.d/9966.feature +++ b/changelog.d/9966.feature @@ -1 +1 @@ -Support [MSC1772](https://github.com/matrix-org/matrix-doc/pull/1772). +Support stable identifiers for [MSC1772](https://github.com/matrix-org/matrix-doc/pull/1772) Spaces. `m.space.child` events will now be taken into account when populating the experimental spaces summary response. Please see `UPGRADE.rst` if you have customised `room_invite_state_types` in your configuration. \ No newline at end of file From 93d433365448396536827ebbfb4323f5f7f189b0 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Tue, 11 May 2021 10:22:26 -0400 Subject: [PATCH 4/4] Apply suggestions from code review Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> --- UPGRADE.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UPGRADE.rst b/UPGRADE.rst index aeb5af17b7c9..606e357b6e39 100644 --- a/UPGRADE.rst +++ b/UPGRADE.rst @@ -92,7 +92,7 @@ Upgrading to v1.34.0 ----------------------------------------------- The ``room_invite_state_types`` configuration setting has been deprecated and -replaced with ``disable_default_event_types`` and ``additional_event_types``. +replaced with ``room_prejoin_state``. See the `sample configuration file `_. If you have set ``room_invite_state_types`` to the default value you should simply remove it from your configuration file. The default value used to be: @@ -112,7 +112,7 @@ your customisations. If you have customised this value by removing state types, you should rename ``room_invite_state_types`` to ``additional_event_types``, and set -``disable_default_event_types`` to ``true`` +``disable_default_event_types`` to ``true``. Upgrading to v1.33.0 ====================