summary refs log tree commit diff
path: root/docs/upgrade.md
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2022-05-31 14:48:22 +0100
committerErik Johnston <erik@matrix.org>2022-05-31 14:48:22 +0100
commit3594f6c1f340f12bfcb2fec9e99ac108a714b508 (patch)
treef7f995f24f23cc3b270b625971f60bc4ad98fb46 /docs/upgrade.md
parentTest Synapse against Complement with workers. (#12810) (diff)
parentUpdate changelog (diff)
downloadsynapse-3594f6c1f340f12bfcb2fec9e99ac108a714b508.tar.xz
Merge branch 'master' into develop
Diffstat (limited to 'docs/upgrade.md')
-rw-r--r--docs/upgrade.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/upgrade.md b/docs/upgrade.md
index e7eadadb64..e3c64da17f 100644
--- a/docs/upgrade.md
+++ b/docs/upgrade.md
@@ -177,11 +177,11 @@ has queries that can be used to check a database for this problem in advance.
 
 </details>
 
-## SpamChecker API's `check_event_for_spam` has a new signature.
+## New signature for the spam checker callback `check_event_for_spam`
 
 The previous signature has been deprecated.
 
-Whereas `check_event_for_spam` callbacks used to return `Union[str, bool]`, they should now return `Union["synapse.module_api.Allow", "synapse.module_api.errors.Codes"]`.
+Whereas `check_event_for_spam` callbacks used to return `Union[str, bool]`, they should now return `Union["synapse.module_api.NOT_SPAM", "synapse.module_api.errors.Codes"]`.
 
 This is part of an ongoing refactoring of the SpamChecker API to make it less ambiguous and more powerful.
 
@@ -204,8 +204,8 @@ async def check_event_for_spam(event):
         # Event is spam, mark it as forbidden (you may use some more precise error
         # code if it is useful).
         return synapse.module_api.errors.Codes.FORBIDDEN
-    # Event is not spam, mark it as `ALLOW`.
-    return synapse.module_api.ALLOW
+    # Event is not spam, mark it as such.
+    return synapse.module_api.NOT_SPAM
 ```
 
 # Upgrading to v1.59.0