summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2017-02-20 16:19:19 +0100
committerGitHub <noreply@github.com>2017-02-20 16:19:19 +0100
commitb5c268738bb13e35e1ed5bd49776648c2bb796e3 (patch)
tree7129ca838a7541b6192ab335566f137e98d9bae3 /synapse
parentMerge remote-tracking branch 'origin/master' into develop (diff)
parentRemove unused param (diff)
downloadsynapse-b5c268738bb13e35e1ed5bd49776648c2bb796e3.tar.xz
Merge pull request #1929 from matrix-org/erikj/context_fix
Fix /context/ visibiltiy rules
Diffstat (limited to 'synapse')
-rw-r--r--synapse/handlers/room.py7
-rw-r--r--synapse/rest/client/v1/room.py1
2 files changed, 5 insertions, 3 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py
index 7e7671c9a2..99cb7db0db 100644
--- a/synapse/handlers/room.py
+++ b/synapse/handlers/room.py
@@ -356,7 +356,7 @@ class RoomCreationHandler(BaseHandler):
 
 class RoomContextHandler(BaseHandler):
     @defer.inlineCallbacks
-    def get_event_context(self, user, room_id, event_id, limit, is_guest):
+    def get_event_context(self, user, room_id, event_id, limit):
         """Retrieves events, pagination tokens and state around a given event
         in a room.
 
@@ -375,12 +375,15 @@ class RoomContextHandler(BaseHandler):
 
         now_token = yield self.hs.get_event_sources().get_current_token()
 
+        users = yield self.store.get_users_in_room(room_id)
+        is_peeking = user.to_string() not in users
+
         def filter_evts(events):
             return filter_events_for_client(
                 self.store,
                 user.to_string(),
                 events,
-                is_peeking=is_guest
+                is_peeking=is_peeking
             )
 
         event = yield self.store.get_event(event_id, get_prev_content=True,
diff --git a/synapse/rest/client/v1/room.py b/synapse/rest/client/v1/room.py
index 728e3df0e3..90242a6bac 100644
--- a/synapse/rest/client/v1/room.py
+++ b/synapse/rest/client/v1/room.py
@@ -505,7 +505,6 @@ class RoomEventContext(ClientV1RestServlet):
             room_id,
             event_id,
             limit,
-            requester.is_guest,
         )
 
         if not results: