summary refs log tree commit diff
path: root/synapse/api
diff options
context:
space:
mode:
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"])