summary refs log tree commit diff
path: root/synapse/handlers/stats.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2021-09-10 10:43:42 +0100
committerRichard van der Hoff <richard@matrix.org>2021-09-10 10:43:42 +0100
commit97ef48b07e79c9d0a61de5a41ef216a1dc495976 (patch)
treee8c5d0caa4655564a0406632ae4c6f778492d845 /synapse/handlers/stats.py
parentRevert "Expand on why users should read upgrade notes" (diff)
parentAsk consent on SSO registration with default mxid (#10733) (diff)
downloadsynapse-97ef48b07e79c9d0a61de5a41ef216a1dc495976.tar.xz
Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes
Diffstat (limited to 'synapse/handlers/stats.py')
-rw-r--r--synapse/handlers/stats.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/handlers/stats.py b/synapse/handlers/stats.py

index 3fd89af2a4..47f2e2a0c1 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 @@ -254,7 +254,7 @@ class StatsHandler: elif typ == EventTypes.Create: room_state["is_federatable"] = ( - event_content.get("m.federate", True) is True + event_content.get(EventContentFields.FEDERATE, True) is True ) elif typ == EventTypes.JoinRules: room_state["join_rules"] = event_content.get("join_rule") @@ -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)