diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2022-06-08 09:00:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-08 09:00:35 -0400 |
commit | dd2d66b0c9f3ff734314fcddb7f90f3225ddb555 (patch) | |
tree | 314df08bb0f45ea2701f4f2793204c41a6212813 /synapse/rest/client/relations.py | |
parent | Use a GitHub form for issues rather than a hard-to-read, easy-to-ignore templ... (diff) | |
download | synapse-dd2d66b0c9f3ff734314fcddb7f90f3225ddb555.tar.xz |
Move the (unstable) `dir` parameter for /relations behind an experimental flag. (#12984)
MSC3715 defines this parameter, but the unstable version of it should be behind an experimental flag.
Diffstat (limited to 'synapse/rest/client/relations.py')
-rw-r--r-- | synapse/rest/client/relations.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/synapse/rest/client/relations.py b/synapse/rest/client/relations.py index 3cae6d2b55..ce97080013 100644 --- a/synapse/rest/client/relations.py +++ b/synapse/rest/client/relations.py @@ -43,6 +43,7 @@ class RelationPaginationServlet(RestServlet): self.auth = hs.get_auth() self.store = hs.get_datastores().main self._relations_handler = hs.get_relations_handler() + self._msc3715_enabled = hs.config.experimental.msc3715_enabled async def on_GET( self, @@ -55,9 +56,15 @@ class RelationPaginationServlet(RestServlet): requester = await self.auth.get_user_by_req(request, allow_guest=True) limit = parse_integer(request, "limit", default=5) - direction = parse_string( - request, "org.matrix.msc3715.dir", default="b", allowed_values=["f", "b"] - ) + if self._msc3715_enabled: + direction = parse_string( + request, + "org.matrix.msc3715.dir", + default="b", + allowed_values=["f", "b"], + ) + else: + direction = "b" from_token_str = parse_string(request, "from") to_token_str = parse_string(request, "to") |