summary refs log tree commit diff
diff options
context:
space:
mode:
authorOlivier Wilkinson (reivilibre) <olivier@librepush.net>2019-08-27 14:34:05 +0100
committerOlivier Wilkinson (reivilibre) <olivier@librepush.net>2019-08-27 14:34:05 +0100
commit07c267c51676fe1df80993da6700f35e69fe6761 (patch)
tree0af2dfe07ee0d2d1a6bb0c19cf51bcbf2a3fe12f
parentFor user stats, handle other membership transitions properly. (diff)
downloadsynapse-07c267c51676fe1df80993da6700f35e69fe6761.tar.xz
For user stats, handle other membership transitions properly.
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
-rw-r--r--synapse/handlers/stats.py5
-rw-r--r--synapse/storage/stats.py5
2 files changed, 3 insertions, 7 deletions
diff --git a/synapse/handlers/stats.py b/synapse/handlers/stats.py
index f065d88a7d..2f7c108181 100644
--- a/synapse/handlers/stats.py
+++ b/synapse/handlers/stats.py
@@ -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:
diff --git a/synapse/storage/stats.py b/synapse/storage/stats.py
index 6832ec6b7f..f86e9bd269 100644
--- a/synapse/storage/stats.py
+++ b/synapse/storage/stats.py
@@ -15,13 +15,10 @@
 # limitations under the License.
 
 import logging
-from threading import Lock
-
-from twisted.internet import defer
 from itertools import chain
+from threading import Lock
 
 from synapse.storage.state_deltas import StateDeltasStore
-from synapse.storage.state_deltas import StateDeltasStore
 from synapse.util.caches.descriptors import cached
 
 logger = logging.getLogger(__name__)