summary refs log tree commit diff
path: root/synapse/handlers/presence.py
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2014-08-29 19:53:33 +0100
committerPaul "LeoNerd" Evans <paul@matrix.org>2014-08-29 19:53:33 +0100
commit93407cf7cff05fa99709ba5055bce329524cef32 (patch)
tree50005f7637b91f1f53bbfa40d5f2c2a98ff7f78e /synapse/handlers/presence.py
parentRenamed get_current_token_part to get_current_key (diff)
downloadsynapse-93407cf7cff05fa99709ba5055bce329524cef32.tar.xz
Bugfixes on presence pushes on user joining:
 * No need to inform clients of status of remote users; as that will
   arrive in due course anyway. We don't -have- the state currently, so
   we'd only send an unknown message

 * Remember to bump the presence serial for the event source, so the
   notifiers will wake up and report it
Diffstat (limited to 'synapse/handlers/presence.py')
-rw-r--r--synapse/handlers/presence.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py
index cc28151e35..93bd07b196 100644
--- a/synapse/handlers/presence.py
+++ b/synapse/handlers/presence.py
@@ -260,19 +260,18 @@ class PresenceHandler(BaseHandler):
 
     @defer.inlineCallbacks
     def user_joined_room(self, user, room_id):
-
         if user.is_mine:
-            self.push_update_to_local_and_remote(
-                observed_user=user,
-                room_ids=[room_id],
-                statuscache=self._get_or_offline_usercache(user),
-            )
+            statuscache = self._get_or_make_usercache(user)
 
-        else:
-            self.push_update_to_clients(
+            # No actual update but we need to bump the serial anyway for the
+            # event source
+            self._user_cachemap_latest_serial += 1
+            statuscache.update({}, serial=self._user_cachemap_latest_serial)
+
+            self.push_update_to_local_and_remote(
                 observed_user=user,
                 room_ids=[room_id],
-                statuscache=self._get_or_offline_usercache(user),
+                statuscache=statuscache,
             )
 
         # We also want to tell them about current presence of people.