Better logging for auto-join. (#5643)

It was pretty unclear what was going on, so I've added a couple of log lines.
This commit is contained in:
Richard van der Hoff 2019-07-08 17:14:51 +01:00 committed by GitHub
parent 4b1f7febc7
commit b70e080b59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

1
changelog.d/5643.misc Normal file
View File

@ -0,0 +1 @@
Improve logging for auto-join when a new user is created.

View File

@ -256,8 +256,14 @@ class RegistrationHandler(BaseHandler):
user_id = None user_id = None
token = None token = None
attempts += 1 attempts += 1
if not self.hs.config.user_consent_at_registration: if not self.hs.config.user_consent_at_registration:
yield self._auto_join_rooms(user_id) yield self._auto_join_rooms(user_id)
else:
logger.info(
"Skipping auto-join for %s because consent is required at registration",
user_id,
)
# Bind any specified emails to this account # Bind any specified emails to this account
current_time = self.hs.get_clock().time_msec() current_time = self.hs.get_clock().time_msec()
@ -298,6 +304,7 @@ class RegistrationHandler(BaseHandler):
count = yield self.store.count_all_users() count = yield self.store.count_all_users()
should_auto_create_rooms = count == 1 should_auto_create_rooms = count == 1
for r in self.hs.config.auto_join_rooms: for r in self.hs.config.auto_join_rooms:
logger.info("Auto-joining %s to %s", user_id, r)
try: try:
if should_auto_create_rooms: if should_auto_create_rooms:
room_alias = RoomAlias.from_string(r) room_alias = RoomAlias.from_string(r)