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

Commit 7f92b16

Browse files
committed
Turns out the doc was also wrong on some things, ugh
1 parent e70ead2 commit 7f92b16

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/modules/spam_checker_callbacks.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@ The available spam checker callbacks are:
1111
### `check_event_for_spam`
1212

1313
_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.ALLOW` and `synapse.module_api.errors.Codes` can be returned by this callback. Returning a boolean or a string is now deprecated._
1616

1717
```python
18-
async def check_event_for_spam(event: "synapse.module_api.EventBase") -> Union["synapse.module_api.ALLOW", "synapse.module_api.error.Codes", str, bool]
18+
async def check_event_for_spam(event: "synapse.module_api.EventBase") -> Union["synapse.module_api.ALLOW", "synapse.module_api.errors.Codes", str, bool]
1919
```
2020

2121
Called when receiving an event from a client or via federation. The callback must return either:
2222
- `synapse.module_api.ALLOW`, to allow the operation. Other callbacks
2323
may still decide to reject it.
24-
- `synapse.api.Codes` to reject the operation with an error code. In case
25-
of doubt, `synapse.api.error.Codes.FORBIDDEN` is a good error code.
24+
- `synapse.module_api.errors.Codes` to reject the operation with an error code. In case
25+
of doubt, `synapse.module_api.errors.Codes.FORBIDDEN` is a good error code.
2626
- (deprecated) a `str` to reject the operation and specify an error message. Note that clients
2727
typically will not localize the error message to the user's preferred locale.
2828
- (deprecated) on `False`, behave as `ALLOW`. Deprecated as confusing, as some
2929
callbacks in expect `True` to allow and others `True` to reject.
30-
- (deprecated) on `True`, behave as `synapse.api.error.Codes.FORBIDDEN`. Deprecated as confusing, as
30+
- (deprecated) on `True`, behave as `synapse.module_api.errors.Codes.FORBIDDEN`. Deprecated as confusing, as
3131
some callbacks in expect `True` to allow and others `True` to reject.
3232

3333
If multiple modules implement this callback, they will be considered in order. If a

0 commit comments

Comments
 (0)