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

Commit

Permalink
pass room version into FederationHandler.on_invite_request
Browse files Browse the repository at this point in the history
  • Loading branch information
richvdh committed Jan 29, 2020
1 parent 759ed08 commit 8ba53f5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog.d/6805.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Refactoring work in preparation for changing the event redaction algorithm.
2 changes: 1 addition & 1 deletion synapse/federation/federation_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ async def on_invite_request(self, origin, content, room_version):
origin_host, _ = parse_server_name(origin)
await self.check_server_matches_acl(origin_host, pdu.room_id)
pdu = await self._check_sigs_and_hash(room_version, pdu)
ret_pdu = await self.handler.on_invite_request(origin, pdu)
ret_pdu = await self.handler.on_invite_request(origin, pdu, room_version)
time_now = self._clock.time_msec()
return {"event": ret_pdu.get_pdu_json(time_now)}

Expand Down
6 changes: 3 additions & 3 deletions synapse/handlers/federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1468,13 +1468,13 @@ def on_send_join_request(self, origin, pdu):
return {"state": list(state.values()), "auth_chain": auth_chain}

@defer.inlineCallbacks
def on_invite_request(self, origin, pdu):
def on_invite_request(
self, origin: str, event: EventBase, room_version: RoomVersion
):
""" We've got an invite event. Process and persist it. Sign it.
Respond with the now signed event.
"""
event = pdu

if event.state_key is None:
raise SynapseError(400, "The invite event did not have a state key")

Expand Down

0 comments on commit 8ba53f5

Please sign in to comment.