summary refs log tree commit diff
path: root/synapse/handlers/register.py
diff options
context:
space:
mode:
authorTravis Ralston <travpc@gmail.com>2020-06-05 11:18:15 -0600
committerGitHub <noreply@github.com>2020-06-05 18:18:15 +0100
commit09099313e6d527938013bb46640efc3768960d21 (patch)
treeda6619c87dfa606f1b81ce432509317e4a77d525 /synapse/handlers/register.py
parentClarifications to the admin api documentation (#7647) (diff)
downloadsynapse-09099313e6d527938013bb46640efc3768960d21.tar.xz
Add an option to disable autojoin for guest accounts (#6637)
Fixes https://github.com/matrix-org/synapse/issues/3177
Diffstat (limited to 'synapse/handlers/register.py')
-rw-r--r--synapse/handlers/register.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/synapse/handlers/register.py b/synapse/handlers/register.py
index ffda09226c..5c7113a3bb 100644
--- a/synapse/handlers/register.py
+++ b/synapse/handlers/register.py
@@ -244,7 +244,13 @@ class RegistrationHandler(BaseHandler):
                     fail_count += 1
 
         if not self.hs.config.user_consent_at_registration:
-            yield defer.ensureDeferred(self._auto_join_rooms(user_id))
+            if not self.hs.config.auto_join_rooms_for_guests and make_guest:
+                logger.info(
+                    "Skipping auto-join for %s because auto-join for guests is disabled",
+                    user_id,
+                )
+            else:
+                yield defer.ensureDeferred(self._auto_join_rooms(user_id))
         else:
             logger.info(
                 "Skipping auto-join for %s because consent is required at registration",