summary refs log tree commit diff
path: root/synapse/api
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-10-01 17:53:07 +0100
committerMark Haines <mark.haines@matrix.org>2015-10-01 17:53:07 +0100
commitf31014b18f618d81cb667c2b01146b246d32760c (patch)
treecc606424425dadc127114ce4da1a300c79d3be36 /synapse/api
parentMerge pull request #288 from matrix-org/markjh/unused_definitions (diff)
downloadsynapse-f31014b18f618d81cb667c2b01146b246d32760c.tar.xz
Start updating the sync API to match the specification
Diffstat (limited to 'synapse/api')
-rw-r--r--synapse/api/filtering.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/api/filtering.py b/synapse/api/filtering.py
index 4d570b74f8..c066ce89ef 100644
--- a/synapse/api/filtering.py
+++ b/synapse/api/filtering.py
@@ -54,7 +54,7 @@ class Filtering(object):
         ]
 
         room_level_definitions = [
-            "state", "events", "ephemeral"
+            "state", "timeline", "ephemeral"
         ]
 
         for key in top_level_definitions:
@@ -135,6 +135,9 @@ class Filter(object):
     def __init__(self, filter_json):
         self.filter_json = filter_json
 
+    def timeline_limit(self):
+        return self.filter_json.get("room", {}).get("timeline", {}).get(limit, 10)
+
     def filter_public_user_data(self, events):
         return self._filter_on_key(events, ["public_user_data"])