summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorDavid Teller <d.o.teller+github@gmail.com>2021-01-18 15:02:22 +0100
committerDavid Teller <d.o.teller+github@gmail.com>2021-01-28 12:29:49 +0100
commit10332c175c829a21b6565bc5e865bca154ffb084 (patch)
tree78f0aba8ad638ec3058c8e8c076c2f35d12f03ad /synapse/handlers
parentAdd notes on integrating with Facebook for SSO login. (#9244) (diff)
downloadsynapse-10332c175c829a21b6565bc5e865bca154ffb084.tar.xz
New API /_synapse/admin/rooms/{roomId}/context/{eventId}
Signed-off-by: David Teller <davidt@element.io>
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/room.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py
index ee27d99135..15e90fdd4e 100644
--- a/synapse/handlers/room.py
+++ b/synapse/handlers/room.py
@@ -1008,6 +1008,7 @@ class RoomContextHandler:
         event_id: str,
         limit: int,
         event_filter: Optional[Filter],
+        use_admin_priviledge: bool = False,
     ) -> Optional[JsonDict]:
         """Retrieves events, pagination tokens and state around a given event
         in a room.
@@ -1020,7 +1021,9 @@ class RoomContextHandler:
                 (excluding state).
             event_filter: the filter to apply to the events returned
                 (excluding the target event_id)
-
+            use_admin_priviledge: if `True`, return all events, regardless
+                of whether `user` has access to them. To be used **ONLY**
+                from the admin API.
         Returns:
             dict, or None if the event isn't found
         """
@@ -1032,7 +1035,11 @@ class RoomContextHandler:
 
         def filter_evts(events):
             return filter_events_for_client(
-                self.storage, user.to_string(), events, is_peeking=is_peeking
+                self.storage,
+                user.to_string(),
+                events,
+                is_peeking=is_peeking,
+                use_admin_priviledge=use_admin_priviledge,
             )
 
         event = await self.store.get_event(