You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/modules/spam_checker_callbacks.md
+15-16Lines changed: 15 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,29 +11,28 @@ The available spam checker callbacks are:
11
11
### `check_event_for_spam`
12
12
13
13
_First introduced in Synapse v1.37.0_
14
-
_Signature extended to support Allow and Code in Synapse v1.60.0_
15
-
_Boolean and string return value types deprecated in Synapse v1.60.0_
14
+
15
+
_Changed in Synapse v1.60.0: `synapse.module_api.NOT_SPAM`and `synapse.module_api.errors.Codes` can be returned by this callback. Returning a boolean or a string is now deprecated._
Copy file name to clipboardExpand all lines: docs/upgrade.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -177,11 +177,11 @@ has queries that can be used to check a database for this problem in advance.
177
177
178
178
</details>
179
179
180
-
## SpamChecker API's `check_event_for_spam` has a new signature.
180
+
## New signature for the spam checker callback `check_event_for_spam`
181
181
182
182
The previous signature has been deprecated.
183
183
184
-
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"]`.
184
+
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"]`.
185
185
186
186
This is part of an ongoing refactoring of the SpamChecker API to make it less ambiguous and more powerful.
0 commit comments