summary refs log tree commit diff
path: root/synapse/rest/client/v2_alpha
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-10-13 10:24:51 +0100
committerMark Haines <mark.haines@matrix.org>2015-10-13 10:24:51 +0100
commit956509dfecccca944d89bc9e9f002e5039cf81fc (patch)
tree249a6e9f86bb4991e0a8e9d2ba75049f7f37d89d /synapse/rest/client/v2_alpha
parentUpdate the filters to match the latest spec. (diff)
downloadsynapse-956509dfecccca944d89bc9e9f002e5039cf81fc.tar.xz
Start spliting out the rooms into joined and invited in v2 sync
Diffstat (limited to 'synapse/rest/client/v2_alpha')
-rw-r--r--synapse/rest/client/v2_alpha/sync.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/synapse/rest/client/v2_alpha/sync.py b/synapse/rest/client/v2_alpha/sync.py
index 1223a4a7f6..9b87879f51 100644
--- a/synapse/rest/client/v2_alpha/sync.py
+++ b/synapse/rest/client/v2_alpha/sync.py
@@ -128,15 +128,19 @@ class SyncRestServlet(RestServlet):
 
         time_now = self.clock.time_msec()
 
-        rooms = self.encode_rooms(
-            sync_result.rooms, filter, time_now, token_id
+        joined = self.encode_joined(
+            sync_result.joined, filter, time_now, token_id
         )
 
         response_content = {
             "presence": self.encode_presence(
                 sync_result.presence, filter, time_now
             ),
-            "rooms": rooms,
+            "rooms": {
+                "joined": joined,
+                "invited": {},
+                "archived": {},
+            },
             "next_batch": sync_result.next_batch.to_string(),
         }
 
@@ -150,18 +154,14 @@ class SyncRestServlet(RestServlet):
             formatted.append(event)
         return {"events": filter.filter_presence(formatted)}
 
-    def encode_rooms(self, rooms, filter, time_now, token_id):
+    def encode_joined(self, rooms, filter, time_now, token_id):
         joined = {}
         for room in rooms:
             joined[room.room_id] = self.encode_room(
                 room, filter, time_now, token_id
             )
 
-        return {
-            "joined": joined,
-            "invited": {},
-            "archived": {},
-        }
+        return joined
 
     @staticmethod
     def encode_room(room, filter, time_now, token_id):