mirror of
https://github.com/element-hq/synapse.git
synced 2026-10-15 09:01:25 +00:00
deploy: a164a46038
This commit is contained in:
@@ -232,6 +232,37 @@ dpkg -i matrix-synapse-py3_1.3.0+stretch1_amd64.deb
|
||||
</code></pre>
|
||||
</li>
|
||||
</ul>
|
||||
<h1 id="upgrading-to-v1610"><a class="header" href="#upgrading-to-v1610">Upgrading to v1.61.0</a></h1>
|
||||
<h2 id="new-signatures-for-spam-checker-callbacks"><a class="header" href="#new-signatures-for-spam-checker-callbacks">New signatures for spam checker callbacks</a></h2>
|
||||
<p>As a followup to changes in v1.60.0, the following spam-checker callbacks have changed signature:</p>
|
||||
<ul>
|
||||
<li><code>user_may_join_room</code></li>
|
||||
<li><code>user_may_invite</code></li>
|
||||
<li><code>user_may_send_3pid_invite</code></li>
|
||||
<li><code>user_may_create_room</code></li>
|
||||
<li><code>user_may_create_room_alias</code></li>
|
||||
<li><code>user_may_publish_room</code></li>
|
||||
<li><code>check_media_file_for_spam</code></li>
|
||||
</ul>
|
||||
<p>For each of these methods, the previous callback signature has been deprecated.</p>
|
||||
<p>Whereas callbacks used to return <code>bool</code>, they should now return <code>Union["synapse.module_api.NOT_SPAM", "synapse.module_api.errors.Codes"]</code>.</p>
|
||||
<p>For instance, if your module implements <code>user_may_join_room</code> as follows:</p>
|
||||
<pre><code class="language-python">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
|
||||
</code></pre>
|
||||
<p>you should rewrite it as follows:</p>
|
||||
<pre><code class="language-python">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
|
||||
</code></pre>
|
||||
<h1 id="upgrading-to-v1600"><a class="header" href="#upgrading-to-v1600">Upgrading to v1.60.0</a></h1>
|
||||
<h2 id="adding-a-new-unique-index-to-state_group_edges-could-fail-if-your-database-is-corrupted"><a class="header" href="#adding-a-new-unique-index-to-state_group_edges-could-fail-if-your-database-is-corrupted">Adding a new unique index to <code>state_group_edges</code> could fail if your database is corrupted</a></h2>
|
||||
<p>This release of Synapse will add a unique index to the <code>state_group_edges</code> table, in order
|
||||
|
||||
Reference in New Issue
Block a user