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-18 16:43:18 +0100
committerPaul "LeoNerd" Evans <paul@matrix.org>2014-08-19 11:16:23 +0100
commit83f031207e3ff1ceaacccaf83df76ea67aeefb1b (patch)
tree194d77f34310c06d80e0fccd482d37fa80cc4973 /synapse/handlers/presence.py
parentDeny __iter__ on UserID/RoomID/RoomName instances as it's a subtle bug that w... (diff)
downloadsynapse-83f031207e3ff1ceaacccaf83df76ea67aeefb1b.tar.xz
Implement and test presence dropping of remote users
Diffstat (limited to '')
-rw-r--r--synapse/handlers/presence.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py
index e8cb83eddb..73ec45c9cb 100644
--- a/synapse/handlers/presence.py
+++ b/synapse/handlers/presence.py
@@ -463,9 +463,13 @@ class PresenceHandler(BaseHandler):
         deferreds = []
 
         if target_user:
-            raise NotImplementedError("TODO: remove one user")
+            if target_user not in self._remote_recvmap:
+                return
+            target_users = set([target_user])
+        else:
+            target_users = self._remote_recvmap.keys()
 
-        remoteusers = [u for u in self._remote_recvmap
+        remoteusers = [u for u in target_users
                        if user in self._remote_recvmap[u]]
         remoteusers_by_domain = partition(remoteusers, lambda u: u.domain)