summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-01-30 15:52:05 +0000
committerMark Haines <mark.haines@matrix.org>2015-01-30 15:52:05 +0000
commit017dfaef4c0d4550acd45d27cdcea1c20766684d (patch)
treecfafd4c92fb052fcc3f790e10aeefa573d033196
parentMerge branch 'client_v2_filter' into client_v2_sync (diff)
downloadsynapse-017dfaef4c0d4550acd45d27cdcea1c20766684d.tar.xz
Add doc string for __nonzero__ overrides for sync results, raise not implemented if the client attempts to do a gapless sync
Diffstat (limited to '')
-rw-r--r--synapse/handlers/sync.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py
index 9e07f30b24..dc69b3cfe7 100644
--- a/synapse/handlers/sync.py
+++ b/synapse/handlers/sync.py
@@ -49,6 +49,9 @@ class RoomSyncResult(collections.namedtuple("RoomSyncResult", [
     __slots__ = []
 
     def __nonzero__(self):
+        """Make the result appear empty if there are no updates. This is used
+        to tell if room needs to be part of the sync result.
+        """
         return bool(self.events or self.state or self.ephemeral)
 
 
@@ -61,6 +64,10 @@ class SyncResult(collections.namedtuple("SyncResult", [
     __slots__ = []
 
     def __nonzero__(self):
+        """Make the result appear empty if there are no updates. This is used
+        to tell if the notifier needs to wait for more events when polling for
+        events.
+        """
         return bool(
             self.private_user_data or self.public_user_data or self.rooms
         )
@@ -108,7 +115,7 @@ class SyncHandler(BaseHandler):
                 return self.incremental_sync_with_gap(sync_config, since_token)
             else:
                 #TODO(mjark): Handle gapless sync
-                pass
+                raise NotImplementedError()
 
     @defer.inlineCallbacks
     def initial_sync(self, sync_config):