diff options
author | Jason Robinson <jasonr@matrix.org> | 2019-09-09 17:37:52 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-09 17:37:52 +0300 |
commit | 63f9317b8e862e01872c0f8a3485748687ccd232 (patch) | |
tree | 737c05ba2b4d9da571b534dfb7f6daa97df8c14b /synapse/handlers/register.py | |
parent | Merge pull request #5934 from matrix-org/erikj/censor_redactions (diff) | |
parent | Fix code style, again (diff) | |
download | synapse-63f9317b8e862e01872c0f8a3485748687ccd232.tar.xz |
Merge pull request #6004 from matrix-org/jaywink/autojoin-create-real-users
Only count real users when checking for auto-creation of auto-join room
Diffstat (limited to 'synapse/handlers/register.py')
-rw-r--r-- | synapse/handlers/register.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/synapse/handlers/register.py b/synapse/handlers/register.py index 975da57ffd..06bd03b77c 100644 --- a/synapse/handlers/register.py +++ b/synapse/handlers/register.py @@ -275,16 +275,12 @@ class RegistrationHandler(BaseHandler): fake_requester = create_requester(user_id) # try to create the room if we're the first real user on the server. Note - # that an auto-generated support user is not a real user and will never be + # that an auto-generated support or bot user is not a real user and will never be # the user to create the room should_auto_create_rooms = False - is_support = yield self.store.is_support_user(user_id) - # There is an edge case where the first user is the support user, then - # the room is never created, though this seems unlikely and - # recoverable from given the support user being involved in the first - # place. - if self.hs.config.autocreate_auto_join_rooms and not is_support: - count = yield self.store.count_all_users() + is_real_user = yield self.store.is_real_user(user_id) + if self.hs.config.autocreate_auto_join_rooms and is_real_user: + count = yield self.store.count_real_users() should_auto_create_rooms = count == 1 for r in self.hs.config.auto_join_rooms: logger.info("Auto-joining %s to %s", user_id, r) |