summary refs log tree commit diff
path: root/synapse/config
diff options
context:
space:
mode:
authorNeil Johnson <neil@matrix.org>2018-10-12 18:17:36 +0100
committerNeil Johnson <neil@matrix.org>2018-10-12 18:17:36 +0100
commita2bfb778c8a2a91bdff1a5824571d91f4f4536d3 (patch)
tree7bf855c7c1cc9bef67efbbec611070958ad4ee44 /synapse/config
parentMerge branch 'develop' into matthew/autocreate_autojoin (diff)
downloadsynapse-a2bfb778c8a2a91bdff1a5824571d91f4f4536d3.tar.xz
improve auto room join logic, comments and tests
Diffstat (limited to 'synapse/config')
-rw-r--r--synapse/config/registration.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/synapse/config/registration.py b/synapse/config/registration.py
index dcf2374ed2..43ff20a637 100644
--- a/synapse/config/registration.py
+++ b/synapse/config/registration.py
@@ -15,6 +15,8 @@
 
 from distutils.util import strtobool
 
+from synapse.config._base import ConfigError
+from synapse.types import RoomAlias
 from synapse.util.stringutils import random_string_with_symbols
 
 from ._base import Config
@@ -44,6 +46,9 @@ 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):
@@ -100,7 +105,11 @@ class RegistrationConfig(Config):
         #auto_join_rooms:
         #    - "#example:example.com"
 
-        # Have first user on server autocreate autojoin rooms
+        # Where auto_join_rooms are specified, setting this flag ensures that the
+        # the rooms exists 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()