mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-09 11:52:10 -04:00
Do not return unspecced original_event field when using the stable /relations endpoint. (#14025)
Keep the old behavior (of including the original_event field) for any requests to the /unstable version of the endpoint, but do not include the field when the /v1 version is used. This should avoid new clients from depending on this field, but will not help with current dependencies.
This commit is contained in:
parent
d42541733d
commit
b706111b78
4 changed files with 28 additions and 17 deletions
|
@ -82,6 +82,11 @@ class RelationPaginationServlet(RestServlet):
|
|||
if to_token_str:
|
||||
to_token = await StreamToken.from_string(self.store, to_token_str)
|
||||
|
||||
# The unstable version of this API returns an extra field for client
|
||||
# compatibility, see https://github.com/matrix-org/synapse/issues/12930.
|
||||
assert request.path is not None
|
||||
include_original_event = request.path.startswith(b"/_matrix/client/unstable/")
|
||||
|
||||
result = await self._relations_handler.get_relations(
|
||||
requester=requester,
|
||||
event_id=parent_id,
|
||||
|
@ -92,6 +97,7 @@ class RelationPaginationServlet(RestServlet):
|
|||
direction=direction,
|
||||
from_token=from_token,
|
||||
to_token=to_token,
|
||||
include_original_event=include_original_event,
|
||||
)
|
||||
|
||||
return 200, result
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue