summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-01-30 11:50:15 +0000
committerMark Haines <mark.haines@matrix.org>2015-01-30 11:50:15 +0000
commit4a67834bc84f604605c618049599f4638434c7cf (patch)
tree8afccc3b3f2bbc61dfe28567ea8723a36a2b3a25 /synapse
parentFix token formatting (diff)
downloadsynapse-4a67834bc84f604605c618049599f4638434c7cf.tar.xz
Pass client info to the sync_config
Diffstat (limited to 'synapse')
-rw-r--r--synapse/handlers/sync.py5
-rw-r--r--synapse/rest/client/v2_alpha/sync.py2
2 files changed, 4 insertions, 3 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py
index 3c68e2a9ec..1a74a4c97c 100644
--- a/synapse/handlers/sync.py
+++ b/synapse/handlers/sync.py
@@ -28,7 +28,7 @@ logger = logging.getLogger(__name__)
 
 SyncConfig = collections.namedtuple("SyncConfig", [
     "user",
-    "device",
+    "client_info",
     "limit",
     "gap",
     "sort",
@@ -288,12 +288,13 @@ class SyncHandler(BaseHandler):
         room_key = now_token.room_key
 
         while limited and len(recents) < sync_config.limit and max_repeat:
-            events, (room_key,_) = yield self.store.get_recent_events_for_room(
+            events, keys = yield self.store.get_recent_events_for_room(
                 room_id,
                 limit=load_limit + 1,
                 from_token=since_token.room_key if since_token else None,
                 end_token=room_key,
             )
+            (room_key, _) = keys
             loaded_recents = sync_config.filter.filter_room_events(events)
             loaded_recents.extend(recents)
             recents = loaded_recents
diff --git a/synapse/rest/client/v2_alpha/sync.py b/synapse/rest/client/v2_alpha/sync.py
index 46ea50d118..81d5cf8ead 100644
--- a/synapse/rest/client/v2_alpha/sync.py
+++ b/synapse/rest/client/v2_alpha/sync.py
@@ -123,7 +123,7 @@ class SyncRestServlet(RestServlet):
 
         sync_config = SyncConfig(
             user=user,
-            device="TODO",  # TODO(mjark) Get the device_id from access_token
+            client_info=client,
             gap=gap,
             limit=limit,
             sort=sort,