diff options
author | erikjohnston <erikjohnston@users.noreply.github.com> | 2022-05-31 13:48:55 +0000 |
---|---|---|
committer | erikjohnston <erikjohnston@users.noreply.github.com> | 2022-05-31 13:48:55 +0000 |
commit | 25eebe534e5fd4fe5ecd2947dde386549c3313ec (patch) | |
tree | fba491865f3150f11a911e2dafc82e53ce704039 /develop/upgrade.html | |
parent | deploy: b2b5279a3f1b4012de664b424f9e9db13ce3c774 (diff) | |
download | synapse-25eebe534e5fd4fe5ecd2947dde386549c3313ec.tar.xz |
deploy: 3594f6c1f340f12bfcb2fec9e99ac108a714b508
Diffstat (limited to '')
-rw-r--r-- | develop/upgrade.html | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/develop/upgrade.html b/develop/upgrade.html index 81eb4ce480..779c77129a 100644 --- a/develop/upgrade.html +++ b/develop/upgrade.html @@ -295,9 +295,9 @@ COMMIT; <p><a href="https://github.com/matrix-org/synapse/issues/11779#issuecomment-1131545970">This comment on issue 11779</a> has queries that can be used to check a database for this problem in advance.</p> </details> -<h2 id="spamchecker-apis-check_event_for_spam-has-a-new-signature"><a class="header" href="#spamchecker-apis-check_event_for_spam-has-a-new-signature">SpamChecker API's <code>check_event_for_spam</code> has a new signature.</a></h2> +<h2 id="new-signature-for-the-spam-checker-callback-check_event_for_spam"><a class="header" href="#new-signature-for-the-spam-checker-callback-check_event_for_spam">New signature for the spam checker callback <code>check_event_for_spam</code></a></h2> <p>The previous signature has been deprecated.</p> -<p>Whereas <code>check_event_for_spam</code> callbacks used to return <code>Union[str, bool]</code>, they should now return <code>Union["synapse.module_api.Allow", "synapse.module_api.errors.Codes"]</code>.</p> +<p>Whereas <code>check_event_for_spam</code> callbacks used to return <code>Union[str, bool]</code>, they should now return <code>Union["synapse.module_api.NOT_SPAM", "synapse.module_api.errors.Codes"]</code>.</p> <p>This is part of an ongoing refactoring of the SpamChecker API to make it less ambiguous and more powerful.</p> <p>If your module implements <code>check_event_for_spam</code> as follows:</p> <pre><code class="language-python">async def check_event_for_spam(event): @@ -313,8 +313,8 @@ has queries that can be used to check a database for this problem in advance.</p # 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 </code></pre> <h1 id="upgrading-to-v1590"><a class="header" href="#upgrading-to-v1590">Upgrading to v1.59.0</a></h1> <h2 id="device-name-lookup-over-federation-has-been-disabled-by-default"><a class="header" href="#device-name-lookup-over-federation-has-been-disabled-by-default">Device name lookup over federation has been disabled by default</a></h2> |