From 51b1225fc79b9c24d202efb23a971bfb21540dac Mon Sep 17 00:00:00 2001 From: DMRobertson Date: Tue, 5 Jul 2022 12:25:53 +0000 Subject: deploy: b51a0f4be0287f88a747952fb3cc8132d29df4c8 --- latest/upgrade.html | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'latest/upgrade.html') diff --git a/latest/upgrade.html b/latest/upgrade.html index 2644a8593b..fc9397a3c4 100644 --- a/latest/upgrade.html +++ b/latest/upgrade.html @@ -76,7 +76,7 @@ @@ -232,6 +232,37 @@ dpkg -i matrix-synapse-py3_1.3.0+stretch1_amd64.deb +

Upgrading to v1.62.0

+

New signatures for spam checker callbacks

+

As a followup to changes in v1.60.0, the following spam-checker callbacks have changed signature:

+ +

For each of these methods, the previous callback signature has been deprecated.

+

Whereas callbacks used to return bool, they should now return Union["synapse.module_api.NOT_SPAM", "synapse.module_api.errors.Codes"].

+

For instance, if your module implements user_may_join_room as follows:

+
async def user_may_join_room(self, user_id: str, room_id: str, is_invited: bool)
+    if ...:
+        # Request is spam
+        return False
+    # Request is not spam
+    return True
+
+

you should rewrite it as follows:

+
async def user_may_join_room(self, user_id: str, room_id: str, is_invited: bool)
+    if ...:
+        # Request 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
+    # Request is not spam, mark it as such.
+    return synapse.module_api.NOT_SPAM
+

Upgrading to v1.61.0

Removal of deprecated community/groups

This release of Synapse will remove deprecated community/groups from codebase.

-- cgit 1.5.1