summary refs log tree commit diff
path: root/synapse/streams/config.py
diff options
context:
space:
mode:
authorDavid Baker <dbkr@matrix.org>2014-12-02 13:50:05 +0000
committerDavid Baker <dbkr@matrix.org>2014-12-02 13:50:05 +0000
commit7642d95d5e90bab130b33dc27f10e347072e0294 (patch)
tree08c618bc5daeceb90bb8a47e3800b88c12d83427 /synapse/streams/config.py
parentMore work on pushers. Attempt to do HTTP pokes. Not sure if the actual HTTP p... (diff)
parentAdd non-working jitsi meet bridge (diff)
downloadsynapse-7642d95d5e90bab130b33dc27f10e347072e0294.tar.xz
Merge branch 'develop' into pushers
Diffstat (limited to 'synapse/streams/config.py')
-rw-r--r--synapse/streams/config.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/synapse/streams/config.py b/synapse/streams/config.py
index 527507e5cd..0317e78c08 100644
--- a/synapse/streams/config.py
+++ b/synapse/streams/config.py
@@ -28,11 +28,11 @@ class SourcePaginationConfig(object):
     specific event source."""
 
     def __init__(self, from_key=None, to_key=None, direction='f',
-                 limit=0):
+                 limit=None):
         self.from_key = from_key
         self.to_key = to_key
         self.direction = 'f' if direction == 'f' else 'b'
-        self.limit = int(limit)
+        self.limit = int(limit) if limit is not None else None
 
 
 class PaginationConfig(object):
@@ -40,11 +40,11 @@ class PaginationConfig(object):
     """A configuration object which stores pagination parameters."""
 
     def __init__(self, from_token=None, to_token=None, direction='f',
-                 limit=0):
+                 limit=None):
         self.from_token = from_token
         self.to_token = to_token
         self.direction = 'f' if direction == 'f' else 'b'
-        self.limit = int(limit)
+        self.limit = int(limit) if limit is not None else None
 
     @classmethod
     def from_request(cls, request, raise_invalid_params=True):
@@ -80,8 +80,8 @@ class PaginationConfig(object):
         except:
             raise SynapseError(400, "'to' paramater is invalid")
 
-        limit = get_param("limit", "0")
-        if not limit.isdigit():
+        limit = get_param("limit", None)
+        if limit is not None and not limit.isdigit():
             raise SynapseError(400, "'limit' parameter must be an integer.")
 
         try: