summary refs log tree commit diff
path: root/synapse/handlers/sync.py
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2016-06-02 15:20:28 +0100
committerMark Haines <mjark@negativecurvature.net>2016-06-02 15:20:28 +0100
commit661a540dd1de89a3ab3a8f6ca0f780ea7d264176 (patch)
treebda20c33f8f639c86a67114cf94ef1a8e28349ef /synapse/handlers/sync.py
parentAllow external processes to mark a user as syncing. (#812) (diff)
downloadsynapse-661a540dd1de89a3ab3a8f6ca0f780ea7d264176.tar.xz
Deduplicate presence entries in sync (#818)
Diffstat (limited to 'synapse/handlers/sync.py')
-rw-r--r--synapse/handlers/sync.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py
index 3b89582d79..5307b62b85 100644
--- a/synapse/handlers/sync.py
+++ b/synapse/handlers/sync.py
@@ -637,6 +637,9 @@ class SyncHandler(object):
         )
         presence.extend(states)
 
+        # Deduplicate the presence entries so that there's at most one per user
+        presence = {p["content"]["user_id"]: p for p in presence}.values()
+
         presence = sync_config.filter_collection.filter_presence(
             presence
         )