summary refs log tree commit diff
path: root/synapse/handlers/stats.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2021-09-06 12:17:16 +0100
committerGitHub <noreply@github.com>2021-09-06 12:17:16 +0100
commit56e2a306348e10b2abfa4a615ebf9c6d43177f6e (patch)
tree0d585f037370ead78fdd120e19579d3a562301b5 /synapse/handlers/stats.py
parentPull out encrypted_by_default tests from user_directory tests (#10752) (diff)
downloadsynapse-56e2a306348e10b2abfa4a615ebf9c6d43177f6e.tar.xz
Move `maybe_kick_guest_users` out of `BaseHandler` (#10744)
This is part of my ongoing war against BaseHandler. I've moved kick_guest_users into RoomMemberHandler (since it calls out to that handler anyway), and split maybe_kick_guest_users into the two places it is called.
Diffstat (limited to '')
-rw-r--r--synapse/handlers/stats.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/handlers/stats.py b/synapse/handlers/stats.py
index 3fd89af2a4..3a4c41c9ff 100644
--- a/synapse/handlers/stats.py
+++ b/synapse/handlers/stats.py
@@ -18,7 +18,7 @@ from typing import TYPE_CHECKING, Any, Dict, Iterable, Optional, Tuple
 
 from typing_extensions import Counter as CounterType
 
-from synapse.api.constants import EventTypes, Membership
+from synapse.api.constants import EventContentFields, EventTypes, Membership
 from synapse.metrics import event_processing_positions
 from synapse.metrics.background_process_metrics import run_as_background_process
 from synapse.types import JsonDict
@@ -273,7 +273,9 @@ class StatsHandler:
             elif typ == EventTypes.CanonicalAlias:
                 room_state["canonical_alias"] = event_content.get("alias")
             elif typ == EventTypes.GuestAccess:
-                room_state["guest_access"] = event_content.get("guest_access")
+                room_state["guest_access"] = event_content.get(
+                    EventContentFields.GUEST_ACCESS
+                )
 
         for room_id, state in room_to_state_updates.items():
             logger.debug("Updating room_stats_state for %s: %s", room_id, state)