Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5998 from matrix-org/erikj/fixup_federate_flag
Browse files Browse the repository at this point in the history
  • Loading branch information
anoadragon453 committed Feb 25, 2020
2 parents 5a1bdf2 + a2a695b commit 4f37881
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/5998.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix room and user stats tracking.
4 changes: 3 additions & 1 deletion synapse/handlers/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,9 @@ def _handle_deltas(self, deltas):
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"
Expand Down
4 changes: 3 additions & 1 deletion synapse/storage/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,9 @@ def _fetch_current_state_stats(txn):
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)

Expand Down

0 comments on commit 4f37881

Please sign in to comment.