diff options
author | Erik Johnston <erik@matrix.org> | 2017-05-15 16:09:32 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2017-05-15 16:09:32 +0100 |
commit | f451b64c8f8db1eebdc7c8bc80352e011b8ae978 (patch) | |
tree | 0f2926b280ee625fd0777effd1b0f840ade7d438 /synapse/rest/client/v2_alpha/sync.py | |
parent | Update comment (diff) | |
parent | Merge pull request #2221 from psaavedra/sync_timeline_limit_filter_by_name (diff) | |
download | synapse-f451b64c8f8db1eebdc7c8bc80352e011b8ae978.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/prefill_state
Diffstat (limited to 'synapse/rest/client/v2_alpha/sync.py')
-rw-r--r-- | synapse/rest/client/v2_alpha/sync.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/rest/client/v2_alpha/sync.py b/synapse/rest/client/v2_alpha/sync.py index f30eab76fd..771e127ab9 100644 --- a/synapse/rest/client/v2_alpha/sync.py +++ b/synapse/rest/client/v2_alpha/sync.py @@ -28,6 +28,7 @@ from synapse.api.filtering import FilterCollection, DEFAULT_FILTER_COLLECTION from synapse.api.errors import SynapseError from synapse.api.constants import PresenceState from ._base import client_v2_patterns +from ._base import set_timeline_upper_limit import itertools import logging @@ -78,6 +79,7 @@ class SyncRestServlet(RestServlet): def __init__(self, hs): super(SyncRestServlet, self).__init__() + self.hs = hs self.auth = hs.get_auth() self.sync_handler = hs.get_sync_handler() self.clock = hs.get_clock() @@ -121,6 +123,8 @@ class SyncRestServlet(RestServlet): if filter_id.startswith('{'): try: filter_object = json.loads(filter_id) + set_timeline_upper_limit(filter_object, + self.hs.config.filter_timeline_limit) except: raise SynapseError(400, "Invalid filter JSON") self.filtering.check_valid_filter(filter_object) |