Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Send out invite rejections and knocks over federation (#10223)
Browse files Browse the repository at this point in the history
ensure that events sent via `send_leave` and `send_knock` are sent on to
the rest of the federation.
  • Loading branch information
richvdh authored Jun 23, 2021
1 parent 27c06a6 commit 8beead6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/10223.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a long-standing bug which meant that invite rejections and knocks were not sent out over federation in a timely manner.
2 changes: 1 addition & 1 deletion scripts-dev/complement.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ if [[ -n "$1" ]]; then
fi

# Run the tests!
go test -v -tags synapse_blacklist,msc2946,msc3083,msc2716 -count=1 $EXTRA_COMPLEMENT_ARGS ./tests
go test -v -tags synapse_blacklist,msc2946,msc3083,msc2716,msc2403 -count=1 $EXTRA_COMPLEMENT_ARGS ./tests
14 changes: 14 additions & 0 deletions synapse/handlers/federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1980,6 +1980,13 @@ async def on_send_leave_request(self, origin: str, pdu: EventBase) -> None:

event.internal_metadata.outlier = False

# Send this event on behalf of the other server.
#
# The remote server isn't a full participant in the room at this point, so
# may not have an up-to-date list of the other homeservers participating in
# the room, so we send it on their behalf.
event.internal_metadata.send_on_behalf_of = origin

context = await self.state_handler.compute_event_context(event)
await self._auth_and_persist_event(origin, event, context)

Expand Down Expand Up @@ -2084,6 +2091,13 @@ async def on_send_knock_request(

event.internal_metadata.outlier = False

# Send this event on behalf of the other server.
#
# The remote server isn't a full participant in the room at this point, so
# may not have an up-to-date list of the other homeservers participating in
# the room, so we send it on their behalf.
event.internal_metadata.send_on_behalf_of = origin

context = await self.state_handler.compute_event_context(event)

event_allowed = await self.third_party_event_rules.check_event_allowed(
Expand Down

0 comments on commit 8beead6

Please sign in to comment.