Add recursion_depth to /relations if recursing (#16775)

This is an extra response parameter just added to MSC3981. In the
current impl, the recursion depth is always 3, so this just returns a
static 3 if the recurse parameter is supplied.
This commit is contained in:
David Baker 2024-01-04 09:57:21 +00:00 committed by GitHub
parent c7d0d02be7
commit 25b3ba5328
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

1
changelog.d/16775.bugfix Normal file
View File

@ -0,0 +1 @@
Adds the recursion_depth parameter to the response of the /relations endpoint if MSC3981 recursion is being performed.

View File

@ -180,6 +180,10 @@ class RelationsHandler:
config=serialize_options,
),
}
if recurse:
return_value["recursion_depth"] = 3
if include_original_event:
# Do not bundle aggregations when retrieving the original event because
# we want the content before relations are applied to it.