summary refs log tree commit diff
diff options
context:
space:
mode:
authorQuentin Gliech <quenting@element.io>2022-06-17 12:39:26 +0200
committerGitHub <noreply@github.com>2022-06-17 11:39:26 +0100
commitc6d617641186221829c644204f24654430858826 (patch)
treeb5030868990d9270005f7b7715f08a62559cf3d8
parentFix logging context misuse when we fail to persist a federation event (#13089) (diff)
downloadsynapse-c6d617641186221829c644204f24654430858826.tar.xz
Allow MSC3030 'timestamp_to_event' calls from anyone on world-readable rooms. (#13062)
Signed-off-by: Quentin Gliech <quenting@element.io>
Diffstat (limited to '')
-rw-r--r--changelog.d/13062.misc1
-rw-r--r--synapse/rest/client/room.py4
2 files changed, 4 insertions, 1 deletions
diff --git a/changelog.d/13062.misc b/changelog.d/13062.misc
new file mode 100644
index 0000000000..d425e9a9ac
--- /dev/null
+++ b/changelog.d/13062.misc
@@ -0,0 +1 @@
+Allow MSC3030 'timestamp_to_event' calls from anyone on world-readable rooms.
diff --git a/synapse/rest/client/room.py b/synapse/rest/client/room.py
index a26e976492..2f513164cb 100644
--- a/synapse/rest/client/room.py
+++ b/synapse/rest/client/room.py
@@ -1177,7 +1177,9 @@ class TimestampLookupRestServlet(RestServlet):
         self, request: SynapseRequest, room_id: str
     ) -> Tuple[int, JsonDict]:
         requester = await self._auth.get_user_by_req(request)
-        await self._auth.check_user_in_room(room_id, requester.user.to_string())
+        await self._auth.check_user_in_room_or_world_readable(
+            room_id, requester.user.to_string()
+        )
 
         timestamp = parse_integer(request, "ts", required=True)
         direction = parse_string(request, "dir", default="f", allowed_values=["f", "b"])