Skip to content

Commit

Permalink
Add recursion_depth to /relations if recursing (#16775)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dbkr authored Jan 4, 2024
1 parent c7d0d02 commit 25b3ba5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/16775.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adds the recursion_depth parameter to the response of the /relations endpoint if MSC3981 recursion is being performed.
4 changes: 4 additions & 0 deletions synapse/handlers/relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ async def get_relations(
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.
Expand Down

0 comments on commit 25b3ba5

Please sign in to comment.