diff options
author | Erik Johnston <erikj@jki.re> | 2017-03-15 16:01:29 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-15 16:01:29 +0000 |
commit | 9d527191bcd14f51ae43cfccf18a34ecb19df801 (patch) | |
tree | 272a697640aaf3c919db0b63967908e89b8f16f5 /synapse/handlers/sync.py | |
parent | Merge pull request #1997 from matrix-org/dbkr/cas_partialdownload (diff) | |
parent | Comment (diff) | |
download | synapse-9d527191bcd14f51ae43cfccf18a34ecb19df801.tar.xz |
Merge pull request #2013 from matrix-org/erikj/presence_FASTER
Format presence events on the edges instead of reformatting them multiple times
Diffstat (limited to 'synapse/handlers/sync.py')
-rw-r--r-- | synapse/handlers/sync.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py index 5572cb883f..33b7fdfe8d 100644 --- a/synapse/handlers/sync.py +++ b/synapse/handlers/sync.py @@ -721,14 +721,14 @@ class SyncHandler(object): extra_users_ids.update(users) extra_users_ids.discard(user.to_string()) - states = yield self.presence_handler.get_states( - extra_users_ids, - as_event=True, - ) - presence.extend(states) + if extra_users_ids: + states = yield self.presence_handler.get_states( + extra_users_ids, + ) + 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() + # Deduplicate the presence entries so that there's at most one per user + presence = {p.user_id: p for p in presence}.values() presence = sync_config.filter_collection.filter_presence( presence |