summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-09-06 14:09:16 +0100
committerErik Johnston <erik@matrix.org>2019-09-06 14:21:06 +0100
commit142c9325c27432f9e40c345166def1dd20355433 (patch)
tree2f39f4f32f88c5beeb7e6d74bc8c04624b0e43e1 /synapse
parentMerge pull request #5991 from matrix-org/erikj/fix_tracing_funcs (diff)
downloadsynapse-142c9325c27432f9e40c345166def1dd20355433.tar.xz
Correctly handle non-bool m.federate flag
Diffstat (limited to 'synapse')
-rw-r--r--synapse/handlers/stats.py4
-rw-r--r--synapse/storage/stats.py4
2 files changed, 6 insertions, 2 deletions
diff --git a/synapse/handlers/stats.py b/synapse/handlers/stats.py
index 921735edb3..3c265f3718 100644
--- a/synapse/handlers/stats.py
+++ b/synapse/handlers/stats.py
@@ -260,7 +260,9 @@ class StatsHandler(StateDeltasHandler):
                         room_stats_delta["local_users_in_room"] += delta
 
             elif typ == EventTypes.Create:
-                room_state["is_federatable"] = event_content.get("m.federate", True)
+                room_state["is_federatable"] = (
+                    event_content.get("m.federate", True) is True
+                )
                 if sender and self.is_mine_id(sender):
                     user_to_stats_deltas.setdefault(sender, Counter())[
                         "rooms_created"
diff --git a/synapse/storage/stats.py b/synapse/storage/stats.py
index 6560173c08..09190d684e 100644
--- a/synapse/storage/stats.py
+++ b/synapse/storage/stats.py
@@ -823,7 +823,9 @@ class StatsStore(StateDeltasStore):
             elif event.type == EventTypes.CanonicalAlias:
                 room_state["canonical_alias"] = event.content.get("alias")
             elif event.type == EventTypes.Create:
-                room_state["is_federatable"] = event.content.get("m.federate", True)
+                room_state["is_federatable"] = (
+                    event.content.get("m.federate", True) is True
+                )
 
         yield self.update_room_state(room_id, room_state)