summary refs log tree commit diff
path: root/synapse/handlers/presence.py
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-08-26 15:06:24 +0100
committerKegan Dougal <kegan@matrix.org>2014-08-26 15:06:24 +0100
commitb07bc9bdbdcf70755c1075e204e36e8ebd44e57d (patch)
treed7943508bd16f2c4e2d81590ad1edcc1ff1d4d5c /synapse/handlers/presence.py
parentMerge branch 'client_server_url_rename' into develop (diff)
parentMerge branch 'develop' of github.com:matrix-org/synapse into client_server_ur... (diff)
downloadsynapse-b07bc9bdbdcf70755c1075e204e36e8ebd44e57d.tar.xz
Merge branch 'client_server_url_rename' into develop
Diffstat (limited to 'synapse/handlers/presence.py')
-rw-r--r--synapse/handlers/presence.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py
index c88cc18788..471dc86163 100644
--- a/synapse/handlers/presence.py
+++ b/synapse/handlers/presence.py
@@ -159,12 +159,11 @@ class PresenceHandler(BaseHandler):
         if allowed_by_subscription:
             defer.returnValue(True)
 
-        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)
+        share_room = yield self.store.do_users_share_a_room(
+            [observer_user, observed_user]
+        )
 
-        defer.returnValue(False)
+        defer.returnValue(share_room)
 
     @defer.inlineCallbacks
     def get_state(self, target_user, auth_user):