diff options
author | Jess Porter <github@lolnerd.net> | 2022-05-23 17:36:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-23 16:36:21 +0000 |
commit | a608ac847b36dd72634f21502be42e785add8b65 (patch) | |
tree | b24858344b2b84c2f438182b2736d3bee93af0c1 /docs/modules | |
parent | Disable 'faster room join' Complement tests when testing against Synapse with... (diff) | |
download | synapse-a608ac847b36dd72634f21502be42e785add8b65.tar.xz |
add SpamChecker callback for silently dropping inbound federated events (#12744)
Signed-off-by: jesopo <github@lolnerd.net>
Diffstat (limited to 'docs/modules')
-rw-r--r-- | docs/modules/spam_checker_callbacks.md | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/modules/spam_checker_callbacks.md b/docs/modules/spam_checker_callbacks.md index 472d957180..27c5a0ed5c 100644 --- a/docs/modules/spam_checker_callbacks.md +++ b/docs/modules/spam_checker_callbacks.md @@ -249,6 +249,24 @@ callback returns `False`, Synapse falls through to the next one. The value of th callback that does not return `False` will be used. If this happens, Synapse will not call any of the subsequent implementations of this callback. +### `should_drop_federated_event` + +_First introduced in Synapse v1.60.0_ + +```python +async def should_drop_federated_event(event: "synapse.events.EventBase") -> bool +``` + +Called when checking whether a remote server can federate an event with us. **Returning +`True` from this function will silently drop a federated event and split-brain our view +of a room's DAG, and thus you shouldn't use this callback unless you know what you are +doing.** + +If multiple modules implement this callback, they will be considered in order. If a +callback returns `False`, Synapse falls through to the next one. The value of the first +callback that does not return `False` will be used. If this happens, Synapse will not call +any of the subsequent implementations of this callback. + ## Example The example below is a module that implements the spam checker callback |