From 383bcec37c75fec152392f0123d21ac4722abeff Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Wed, 15 Jun 2022 12:10:58 +0200 Subject: [PATCH] Allow MSC3030 'timestamp_to_event' calls from anyone on world-readable rooms. Signed-off-by: Quentin Gliech --- changelog.d/13062.misc | 1 + synapse/rest/client/room.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelog.d/13062.misc diff --git a/changelog.d/13062.misc b/changelog.d/13062.misc new file mode 100644 index 000000000000..d425e9a9ac26 --- /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 a26e976492c9..2f513164cb84 100644 --- a/synapse/rest/client/room.py +++ b/synapse/rest/client/room.py @@ -1177,7 +1177,9 @@ async def on_GET( 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"])