summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-09-12 16:44:26 +0100
committerErik Johnston <erik@matrix.org>2017-09-12 16:44:26 +0100
commit9ce866ed4f68450d8a2eab84be759c0056b6b992 (patch)
tree1dae373a666668c6b55bae7292d078374c8cba56
parentAdd left section to /keys/changes (diff)
downloadsynapse-9ce866ed4f68450d8a2eab84be759c0056b6b992.tar.xz
In sync handle device lists for newly joined/left rooms
-rw-r--r--synapse/handlers/sync.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py
index 9ae7fbc797..d1ba75dbda 100644
--- a/synapse/handlers/sync.py
+++ b/synapse/handlers/sync.py
@@ -599,12 +599,20 @@ class SyncHandler(object):
                 since_token.device_list_key
             )
 
+            # TODO: Be more clever than this, i.e. remove users who we already
+            # share a room with?
+            for room_id in newly_joined_rooms:
+                joined_users = yield self.state.get_current_user_in_room(room_id)
+                newly_joined_users.update(joined_users)
+
+            for room_id in newly_left_rooms:
+                left_users = yield self.state.get_current_user_in_room(room_id)
+                newly_left_users.update(left_users)
+
             # TODO: Check that these users are actually new, i.e. either they
             # weren't in the previous sync *or* they left and rejoined.
             changed.update(newly_joined_users)
 
-            # TODO: Add the members from newly_*_rooms
-
             if not changed and not newly_left_users:
                 defer.returnValue(DeviceLists(
                     changed=[],