mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-18 17:10:43 +03:00
Create room_stats rows for new rooms. #5624
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
This commit is contained in:
parent
c831c5b2bb
commit
20ae4afe7e
1 changed files with 17 additions and 0 deletions
|
@ -246,6 +246,23 @@ class StatsHandler(StateDeltasHandler):
|
|||
},
|
||||
)
|
||||
|
||||
# Also add room stats with just the one state event
|
||||
# (the room creation state event)
|
||||
yield self.store.update_stats(
|
||||
"room",
|
||||
room_id,
|
||||
now,
|
||||
{
|
||||
"bucket_size": self.stats_bucket_size,
|
||||
"current_state_events": 1,
|
||||
"joined_members": 0,
|
||||
"invited_members": 0,
|
||||
"left_members": 0,
|
||||
"banned_members": 0,
|
||||
"state_events": 1,
|
||||
},
|
||||
)
|
||||
|
||||
elif typ == EventTypes.JoinRules:
|
||||
yield self.store.update_room_state(
|
||||
room_id, {"join_rules": event_content.get("join_rule")}
|
||||
|
|
Loading…
Reference in a new issue