mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-07 16:35:05 -04:00
Support the stable dir parameter for /relations. (#13920)
Since MSC3715 has passed FCP, the stable parameter can be used. This currently falls back to the unstable parameter if the stable parameter is not provided (and MSC3715 support is enabled in the configuration).
This commit is contained in:
parent
299b00d968
commit
87fe9db467
3 changed files with 18 additions and 13 deletions
|
@ -56,15 +56,21 @@ class RelationPaginationServlet(RestServlet):
|
|||
requester = await self.auth.get_user_by_req(request, allow_guest=True)
|
||||
|
||||
limit = parse_integer(request, "limit", default=5)
|
||||
if self._msc3715_enabled:
|
||||
direction = parse_string(
|
||||
request,
|
||||
"org.matrix.msc3715.dir",
|
||||
default="b",
|
||||
allowed_values=["f", "b"],
|
||||
)
|
||||
else:
|
||||
direction = "b"
|
||||
# Fetch the direction parameter, if provided.
|
||||
#
|
||||
# TODO Use PaginationConfig.from_request when the unstable parameter is
|
||||
# no longer needed.
|
||||
direction = parse_string(request, "dir", allowed_values=["f", "b"])
|
||||
if direction is None:
|
||||
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")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue