summary refs log tree commit diff
path: root/synapse/config
diff options
context:
space:
mode:
authorNeil Johnson <neil@matrix.org>2018-10-25 15:00:40 +0100
committerGitHub <noreply@github.com>2018-10-25 15:00:40 +0100
commitc99b6c66bf023af8f5aa4a7aaa04eac682ce3860 (patch)
treef6c28616c938cedecc18b7d8326cffa175c7395c /synapse/config
parentoops, run the check_isort build (diff)
parentMerge branch 'develop' of github.com:matrix-org/synapse into matthew/autocrea... (diff)
downloadsynapse-c99b6c66bf023af8f5aa4a7aaa04eac682ce3860.tar.xz
Merge pull request #3975 from matrix-org/matthew/autocreate_autojoin
Autocreate autojoin rooms
Diffstat (limited to 'synapse/config')
-rw-r--r--synapse/config/registration.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/synapse/config/registration.py b/synapse/config/registration.py
index 0fb964eb67..7480ed5145 100644
--- a/synapse/config/registration.py
+++ b/synapse/config/registration.py
@@ -15,10 +15,10 @@
 
 from distutils.util import strtobool
 
+from synapse.config._base import Config, ConfigError
+from synapse.types import RoomAlias
 from synapse.util.stringutils import random_string_with_symbols
 
-from ._base import Config
-
 
 class RegistrationConfig(Config):
 
@@ -44,6 +44,10 @@ class RegistrationConfig(Config):
         )
 
         self.auto_join_rooms = config.get("auto_join_rooms", [])
+        for room_alias in self.auto_join_rooms:
+            if not RoomAlias.is_valid(room_alias):
+                raise ConfigError('Invalid auto_join_rooms entry %s' % (room_alias,))
+        self.autocreate_auto_join_rooms = config.get("autocreate_auto_join_rooms", True)
 
     def default_config(self, **kwargs):
         registration_shared_secret = random_string_with_symbols(50)
@@ -98,6 +102,13 @@ class RegistrationConfig(Config):
         # to these rooms
         #auto_join_rooms:
         #    - "#example:example.com"
+
+        # Where auto_join_rooms are specified, setting this flag ensures that the
+        # the rooms exist by creating them when the first user on the
+        # homeserver registers.
+        # Setting to false means that if the rooms are not manually created,
+        # users cannot be auto-joined since they do not exist.
+        autocreate_auto_join_rooms: true
         """ % locals()
 
     def add_arguments(self, parser):