mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-20 02:24:54 +03:00
For user stats, handle other membership transitions properly.
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
This commit is contained in:
parent
99c88ac84e
commit
dd8e6020d8
1 changed files with 16 additions and 12 deletions
|
@ -217,10 +217,14 @@ class StatsHandler(StateDeltasHandler):
|
||||||
raise ValueError(err)
|
raise ValueError(err)
|
||||||
|
|
||||||
user_id = state_key
|
user_id = state_key
|
||||||
if self.is_mine_id(user_id) and membership in (
|
if self.is_mine_id(user_id):
|
||||||
Membership.JOIN,
|
# this accounts for transitions like leave → ban and so on.
|
||||||
Membership.LEAVE,
|
has_changed_joinedness = (
|
||||||
) and prev_membership != membership:
|
(prev_membership == Membership.JOIN) !=
|
||||||
|
(membership == Membership.JOIN)
|
||||||
|
)
|
||||||
|
|
||||||
|
if has_changed_joinedness:
|
||||||
# update user_stats as it's one of our users
|
# update user_stats as it's one of our users
|
||||||
public = yield self._is_public_room(room_id)
|
public = yield self._is_public_room(room_id)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue