diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2022-02-22 12:17:10 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-22 12:17:10 +0000 |
commit | 7273011f60afbb1c9754ec73ee3661b19dca6bbd (patch) | |
tree | 4fb48fc09526d15d2e5d0b6ebaff7d9cf95790bb /synapse/federation/federation_base.py | |
parent | Fetch images when previewing Twitter URLs. (#11985) (diff) | |
download | synapse-7273011f60afbb1c9754ec73ee3661b19dca6bbd.tar.xz |
Faster joins: Support for calling `/federation/v1/state` (#12013)
This is an endpoint that we have server-side support for, but no client-side support. It's going to be useful for resyncing partial-stated rooms, so let's introduce it.
Diffstat (limited to 'synapse/federation/federation_base.py')
-rw-r--r-- | synapse/federation/federation_base.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/synapse/federation/federation_base.py b/synapse/federation/federation_base.py index 896168c05c..fab6da3c08 100644 --- a/synapse/federation/federation_base.py +++ b/synapse/federation/federation_base.py @@ -47,6 +47,11 @@ class FederationBase: ) -> EventBase: """Checks that event is correctly signed by the sending server. + Also checks the content hash, and redacts the event if there is a mismatch. + + Also runs the event through the spam checker; if it fails, redacts the event + and flags it as soft-failed. + Args: room_version: The room version of the PDU pdu: the event to be checked @@ -55,7 +60,10 @@ class FederationBase: * the original event if the checks pass * a redacted version of the event (if the signature matched but the hash did not) - * throws a SynapseError if the signature check failed.""" + + Raises: + SynapseError if the signature check failed. + """ try: await _check_sigs_on_pdu(self.keyring, room_version, pdu) except SynapseError as e: |