diff options
author | Erik Johnston <erik@matrix.org> | 2019-09-06 15:32:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-06 15:32:43 +0100 |
commit | a2a695b7eccd434ba504e1e366a6d6a7fdc7cd4f (patch) | |
tree | 75119861653196580006f40acaf61b3a47fe6abb | |
parent | Merge pull request #5993 from matrix-org/anoa/worker_store_reg (diff) | |
parent | Newsfile (diff) | |
download | synapse-a2a695b7eccd434ba504e1e366a6d6a7fdc7cd4f.tar.xz |
Merge pull request #5998 from matrix-org/erikj/fixup_federate_flag
Correctly handle non-bool m.federate flag
-rw-r--r-- | changelog.d/5998.bugfix | 1 | ||||
-rw-r--r-- | synapse/handlers/stats.py | 4 | ||||
-rw-r--r-- | synapse/storage/stats.py | 4 |
3 files changed, 7 insertions, 2 deletions
diff --git a/changelog.d/5998.bugfix b/changelog.d/5998.bugfix new file mode 100644 index 0000000000..9ea095103b --- /dev/null +++ b/changelog.d/5998.bugfix @@ -0,0 +1 @@ +Fix room and user stats tracking. 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) |