mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-26 03:25:53 +03:00
Correctly handle non-bool m.federate flag
This commit is contained in:
parent
146af7b47f
commit
142c9325c2
2 changed files with 6 additions and 2 deletions
|
@ -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"
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue