mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-19 17:56:19 +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
dd8e6020d8
commit
07c267c516
2 changed files with 3 additions and 7 deletions
|
@ -219,9 +219,8 @@ class StatsHandler(StateDeltasHandler):
|
|||
user_id = state_key
|
||||
if self.is_mine_id(user_id):
|
||||
# this accounts for transitions like leave → ban and so on.
|
||||
has_changed_joinedness = (
|
||||
(prev_membership == Membership.JOIN) !=
|
||||
(membership == Membership.JOIN)
|
||||
has_changed_joinedness = (prev_membership == Membership.JOIN) != (
|
||||
membership == Membership.JOIN
|
||||
)
|
||||
|
||||
if has_changed_joinedness:
|
||||
|
|
|
@ -15,12 +15,9 @@
|
|||
# limitations under the License.
|
||||
|
||||
import logging
|
||||
from itertools import chain
|
||||
from threading import Lock
|
||||
|
||||
from twisted.internet import defer
|
||||
from itertools import chain
|
||||
|
||||
from synapse.storage.state_deltas import StateDeltasStore
|
||||
from synapse.storage.state_deltas import StateDeltasStore
|
||||
from synapse.util.caches.descriptors import cached
|
||||
|
||||
|
|
Loading…
Reference in a new issue