summary refs log tree commit diff
path: root/synapse/config/server.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-07-25 22:10:39 +0100
committerRichard van der Hoff <richard@matrix.org>2018-08-03 16:08:32 +0100
commit0ca459ea334ff86016bda241c0c823178789c215 (patch)
treea3611adf9b0cc2e4a666377293ee9b558433f608 /synapse/config/server.py
parentDocstrings for BaseFederationServlet (diff)
downloadsynapse-0ca459ea334ff86016bda241c0c823178789c215.tar.xz
Basic support for room versioning
This is the first tranche of support for room versioning. It includes:
 * setting the default room version in the config file
 * new room_version param on the createRoom API
 * storing the version of newly-created rooms in the m.room.create event
 * fishing the version of existing rooms out of the m.room.create event
Diffstat (limited to 'synapse/config/server.py')
-rw-r--r--synapse/config/server.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/synapse/config/server.py b/synapse/config/server.py
index 6a471a0a5e..68ef2789d3 100644
--- a/synapse/config/server.py
+++ b/synapse/config/server.py
@@ -16,6 +16,7 @@
 
 import logging
 
+from synapse.api.constants import KNOWN_ROOM_VERSIONS
 from synapse.http.endpoint import parse_and_validate_server_name
 
 from ._base import Config, ConfigError
@@ -75,6 +76,16 @@ class ServerConfig(Config):
             )
         else:
             self.max_mau_value = 0
+
+        # the version of rooms created by default on this server
+        self.default_room_version = str(config.get(
+            "default_room_version", "1",
+        ))
+        if self.default_room_version not in KNOWN_ROOM_VERSIONS:
+            raise ConfigError("Unrecognised value '%s' for default_room_version" % (
+                self.default_room_version,
+            ))
+
         # FIXME: federation_domain_whitelist needs sytests
         self.federation_domain_whitelist = None
         federation_domain_whitelist = config.get(
@@ -249,6 +260,9 @@ class ServerConfig(Config):
         # (except those sent by local server admins). The default is False.
         # block_non_admin_invites: True
 
+        # The room_version of rooms which are created by default by this server.
+        # default_room_version: 1
+
         # Restrict federation to the following whitelist of domains.
         # N.B. we recommend also firewalling your federation listener to limit
         # inbound federation traffic as early as possible, rather than relying