summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2015-01-27 15:58:27 +0000
committerDavid Baker <dave@matrix.org>2015-01-27 15:58:27 +0000
commit1d779691248be2fcdd43e97352d13c2cef239c10 (patch)
tree0b6b40aec503ca42f77b968c6d84b204edefeb48 /synapse/handlers
parentSupport membership events and more camelcase/underscores (diff)
downloadsynapse-1d779691248be2fcdd43e97352d13c2cef239c10.tar.xz
Unbreak bad presence merge - don't add these blocks together with an and: they're different things.
Diffstat (limited to '')
-rw-r--r--synapse/handlers/events.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/synapse/handlers/events.py b/synapse/handlers/events.py
index 75fb941008..f1a3e4a4ad 100644
--- a/synapse/handlers/events.py
+++ b/synapse/handlers/events.py
@@ -51,19 +51,21 @@ class EventStreamHandler(BaseHandler):
         auth_user = self.hs.parse_userid(auth_user_id)
 
         try:
-            if affect_presence and auth_user not in self._streams_per_user:
-                self._streams_per_user[auth_user] = 0
-                if auth_user in self._stop_timer_per_user:
-                    try:
-                        self.clock.cancel_call_later(
-                            self._stop_timer_per_user.pop(auth_user)
+            if affect_presence:
+                if auth_user not in self._streams_per_user:
+                    self._streams_per_user[auth_user] = 0
+                    if auth_user in self._stop_timer_per_user:
+                        try:
+                            print "cancel",auth_user
+                            self.clock.cancel_call_later(
+                                self._stop_timer_per_user.pop(auth_user)
+                            )
+                        except:
+                            logger.exception("Failed to cancel event timer")
+                    else:
+                        yield self.distributor.fire(
+                            "started_user_eventstream", auth_user
                         )
-                    except:
-                        logger.exception("Failed to cancel event timer")
-                else:
-                    yield self.distributor.fire(
-                        "started_user_eventstream", auth_user
-                    )
                 self._streams_per_user[auth_user] += 1
 
             if pagin_config.from_token is None: