summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2016-09-09 14:45:21 +0100
committerGitHub <noreply@github.com>2016-09-09 14:45:21 +0100
commitea05155a8c307c86c811c7ec21c39e99bb5414f4 (patch)
tree92f0d383782e555975e80f8880afb3f74a18e46c
parentMerge pull request #1092 from matrix-org/erikj/transaction_queue_check (diff)
parentDeduplicate presence in _update_states (diff)
downloadsynapse-ea05155a8c307c86c811c7ec21c39e99bb5414f4.tar.xz
Merge pull request #1093 from matrix-org/erikj/dedupe_presence
Deduplicate presence in _update_states
Diffstat (limited to '')
-rw-r--r--synapse/handlers/presence.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py
index 7a3c16a8aa..16dbddee03 100644
--- a/synapse/handlers/presence.py
+++ b/synapse/handlers/presence.py
@@ -265,6 +265,12 @@ class PresenceHandler(object):
             to_notify = {}  # Changes we want to notify everyone about
             to_federation_ping = {}  # These need sending keep-alives
 
+            # Only bother handling the last presence change for each user
+            new_states_dict = {}
+            for new_state in new_states:
+                new_states_dict[new_state.user_id] = new_state
+            new_state = new_states_dict.values()
+
             for new_state in new_states:
                 user_id = new_state.user_id