summary refs log tree commit diff
path: root/synapse/handlers/presence.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-08-18 15:53:40 +0100
committerErik Johnston <erik@matrix.org>2014-08-18 15:53:40 +0100
commitb4a1f2ccb58d6e17372dca310b627364d9792684 (patch)
tree4cbb906a7c33a810b5da2b9e2c60eac6d5738d6f /synapse/handlers/presence.py
parentAdd two different columns for ordering the events table, one which can be use... (diff)
parentUpdate the default longpoll timeout time. (diff)
downloadsynapse-b4a1f2ccb58d6e17372dca310b627364d9792684.tar.xz
Merge branch 'master' of github.com:matrix-org/synapse into sql_refactor
Diffstat (limited to 'synapse/handlers/presence.py')
-rw-r--r--synapse/handlers/presence.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py
index f0d7b34682..e8cb83eddb 100644
--- a/synapse/handlers/presence.py
+++ b/synapse/handlers/presence.py
@@ -155,7 +155,10 @@ class PresenceHandler(BaseHandler):
         if allowed_by_subscription:
             defer.returnValue(True)
 
-        # TODO(paul): Check same channel
+        rm_handler = self.homeserver.get_handlers().room_member_handler
+        for room_id in (yield rm_handler.get_rooms_for_user(observer_user)):
+            if observed_user in (yield rm_handler.get_room_members(room_id)):
+                defer.returnValue(True)
 
         defer.returnValue(False)
 
@@ -166,16 +169,11 @@ class PresenceHandler(BaseHandler):
                 observed_user=target_user
             )
 
-            if visible or True: # XXX: FIXME: Bodge to unbreak matrix.org. breaks UTs.
+            if visible:
                 state = yield self.store.get_presence_state(
                     target_user.localpart
                 )
             else:
-                # FIXME: *Surely* we shouldn't be 404ing the whole request, whatever
-                # it is, just because presence info isn't visible?!
-                # This causes client/api/v1/rooms/!cURbafjkfsMDVwdRDQ%3Amatrix.org/members/list
-                # to 404 currently
-
                 raise SynapseError(404, "Presence information not visible")
         else:
             # TODO(paul): Have remote server send us permissions set