summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2014-12-03 19:48:14 +0000
committerPaul "LeoNerd" Evans <paul@matrix.org>2014-12-03 19:48:14 +0000
commitf5d2514fc05e062b1425139c5064cd5bae3c3ca7 (patch)
treeb4a880d3f3bd596c54535c9c0528ea71969ee5d6 /synapse
parentStore any incoming presence push in the local cache anyway, even if there's n... (diff)
downloadsynapse-f5d2514fc05e062b1425139c5064cd5bae3c3ca7.tar.xz
@log_function on PresenceStream's get_new_events_for_user()
Diffstat (limited to '')
-rw-r--r--synapse/handlers/presence.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py
index d40218dd28..84a039489f 100644
--- a/synapse/handlers/presence.py
+++ b/synapse/handlers/presence.py
@@ -804,6 +804,7 @@ class PresenceEventSource(object):
             )
 
     @defer.inlineCallbacks
+    @log_function
     def get_new_events_for_user(self, user, from_key, limit):
         from_key = int(from_key)
 
@@ -816,7 +817,8 @@ class PresenceEventSource(object):
         # TODO(paul): use a DeferredList ? How to limit concurrency.
         for observed_user in cachemap.keys():
             cached = cachemap[observed_user]
-            if not (from_key < cached.serial):
+
+            if cached.serial <= from_key:
                 continue
 
             if (yield self.is_visible(observer_user, observed_user)):