diff options
author | Erik Johnston <erik@matrix.org> | 2018-10-26 16:22:45 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2018-10-26 16:22:45 +0100 |
commit | 03e634dad4cd1014f609ece9574df7a24f1ec254 (patch) | |
tree | a9f4a53a03bb0205e616ce7cf741fdbd15d4fcf5 /synapse/config/registration.py | |
parent | pep8 (diff) | |
parent | Port register_new_matrix_user to Python 3 and add tests (#4085) (diff) | |
download | synapse-03e634dad4cd1014f609ece9574df7a24f1ec254.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/purge_state_groups
Diffstat (limited to 'synapse/config/registration.py')
-rw-r--r-- | synapse/config/registration.py | 15 |
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): |