summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2021-08-20 07:17:50 -0400
committerGitHub <noreply@github.com>2021-08-20 07:17:50 -0400
commit5cda75fedef3dd02d3b456231be0a1b4bff2a31a (patch)
tree7fb4684264150511dc9dc701c08017668ecf3dfd
parentFix typo in release notes (#10646) (diff)
downloadsynapse-5cda75fedef3dd02d3b456231be0a1b4bff2a31a.tar.xz
Set room version 8 as preferred for restricted rooms. (#10571)
-rw-r--r--changelog.d/10571.feature1
-rw-r--r--synapse/api/room_versions.py2
-rw-r--r--synapse/config/experimental.py2
-rw-r--r--tests/rest/client/v2_alpha/test_capabilities.py4
4 files changed, 5 insertions, 4 deletions
diff --git a/changelog.d/10571.feature b/changelog.d/10571.feature
new file mode 100644
index 0000000000..0da318cd5b
--- /dev/null
+++ b/changelog.d/10571.feature
@@ -0,0 +1 @@
+Enable room capabilities ([MSC3244](https://github.com/matrix-org/matrix-doc/pull/3244)) by default and set room version 8 as the preferred room version for restricted rooms.
diff --git a/synapse/api/room_versions.py b/synapse/api/room_versions.py
index 11280c4462..8abcdfd4fd 100644
--- a/synapse/api/room_versions.py
+++ b/synapse/api/room_versions.py
@@ -293,7 +293,7 @@ MSC3244_CAPABILITIES = {
         ),
         RoomVersionCapability(
             "restricted",
-            None,
+            RoomVersions.V8,
             lambda room_version: room_version.msc3083_join_rules,
         ),
     )
diff --git a/synapse/config/experimental.py b/synapse/config/experimental.py
index b918fb15b0..907df9591a 100644
--- a/synapse/config/experimental.py
+++ b/synapse/config/experimental.py
@@ -37,7 +37,7 @@ class ExperimentalConfig(Config):
         self.msc2285_enabled: bool = experimental.get("msc2285_enabled", False)
 
         # MSC3244 (room version capabilities)
-        self.msc3244_enabled: bool = experimental.get("msc3244_enabled", False)
+        self.msc3244_enabled: bool = experimental.get("msc3244_enabled", True)
 
         # MSC3266 (room summary api)
         self.msc3266_enabled: bool = experimental.get("msc3266_enabled", False)
diff --git a/tests/rest/client/v2_alpha/test_capabilities.py b/tests/rest/client/v2_alpha/test_capabilities.py
index ad83b3d2ff..13b3c5f499 100644
--- a/tests/rest/client/v2_alpha/test_capabilities.py
+++ b/tests/rest/client/v2_alpha/test_capabilities.py
@@ -102,7 +102,8 @@ class CapabilitiesTestCase(unittest.HomeserverTestCase):
         self.assertEqual(channel.code, 200)
         self.assertFalse(capabilities["m.change_password"]["enabled"])
 
-    def test_get_does_not_include_msc3244_fields_by_default(self):
+    @override_config({"experimental_features": {"msc3244_enabled": False}})
+    def test_get_does_not_include_msc3244_fields_when_disabled(self):
         localpart = "user"
         password = "pass"
         user = self.register_user(localpart, password)
@@ -120,7 +121,6 @@ class CapabilitiesTestCase(unittest.HomeserverTestCase):
             "org.matrix.msc3244.room_capabilities", capabilities["m.room_versions"]
         )
 
-    @override_config({"experimental_features": {"msc3244_enabled": True}})
     def test_get_does_include_msc3244_fields_when_enabled(self):
         localpart = "user"
         password = "pass"