summary refs log tree commit diff
path: root/synapse/handlers/presence.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-02-23 14:57:45 +0000
committerErik Johnston <erik@matrix.org>2016-02-23 14:57:45 +0000
commit6e0209112bfb7fc2eee958bfc2e425b1cd399505 (patch)
treee8d8bc506545918b86a677c577e55beb9665d616 /synapse/handlers/presence.py
parentChange the way we figure out presence updates for small deltas (diff)
downloadsynapse-6e0209112bfb7fc2eee958bfc2e425b1cd399505.tar.xz
Add comments
Diffstat (limited to 'synapse/handlers/presence.py')
-rw-r--r--synapse/handlers/presence.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py
index 84624d4902..ff62d47679 100644
--- a/synapse/handlers/presence.py
+++ b/synapse/handlers/presence.py
@@ -859,6 +859,8 @@ class PresenceEventSource(object):
 
             user_ids_changed = set()
             if from_key and from_key < 100:
+                # For small deltas, its quicker to get all changes and then
+                # work out if we share a room or they're in our presence list
                 changed = stream_change_cache.get_all_entities_changed(from_key)
 
                 for other_user_id in changed:
@@ -870,6 +872,8 @@ class PresenceEventSource(object):
                         user_ids_changed.add(other_user_id)
                         continue
             else:
+                # Too many possible updates. Find all users we can see and check
+                # if any of them have changed.
                 user_ids_to_check = set()
                 for room_id in room_ids:
                     users = yield self.store.get_users_in_room(room_id)