mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-29 15:39:00 +03:00
deploy: 872dbb0181
This commit is contained in:
parent
4c12f9d288
commit
e051cb0543
4 changed files with 14 additions and 10 deletions
|
@ -302,7 +302,7 @@ callback that does not return <code>True</code> will be used. If this happens, S
|
||||||
any of the subsequent implementations of this callback.</p>
|
any of the subsequent implementations of this callback.</p>
|
||||||
<h3 id="check_username_for_spam"><a class="header" href="#check_username_for_spam"><code>check_username_for_spam</code></a></h3>
|
<h3 id="check_username_for_spam"><a class="header" href="#check_username_for_spam"><code>check_username_for_spam</code></a></h3>
|
||||||
<p><em>First introduced in Synapse v1.37.0</em></p>
|
<p><em>First introduced in Synapse v1.37.0</em></p>
|
||||||
<pre><code class="language-python">async def check_username_for_spam(user_profile: Dict[str, str]) -> bool
|
<pre><code class="language-python">async def check_username_for_spam(user_profile: synapse.module_api.UserProfile) -> bool
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<p>Called when computing search results in the user directory. The module must return a
|
<p>Called when computing search results in the user directory. The module must return a
|
||||||
<code>bool</code> indicating whether the given user should be excluded from user directory
|
<code>bool</code> indicating whether the given user should be excluded from user directory
|
||||||
|
@ -310,9 +310,11 @@ searches. Return <code>True</code> to indicate that the user is spammy and exclu
|
||||||
search results; otherwise return <code>False</code>.</p>
|
search results; otherwise return <code>False</code>.</p>
|
||||||
<p>The profile is represented as a dictionary with the following keys:</p>
|
<p>The profile is represented as a dictionary with the following keys:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><code>user_id</code>: The Matrix ID for this user.</li>
|
<li><code>user_id: str</code>. The Matrix ID for this user.</li>
|
||||||
<li><code>display_name</code>: The user's display name.</li>
|
<li><code>display_name: Optional[str]</code>. The user's display name, or <code>None</code> if this user
|
||||||
<li><code>avatar_url</code>: The <code>mxc://</code> URL to the user's avatar.</li>
|
has not set a display name.</li>
|
||||||
|
<li><code>avatar_url: Optional[str]</code>. The <code>mxc://</code> URL to the user's avatar, or <code>None</code>
|
||||||
|
if this user has not set an avatar.</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>The module is given a copy of the original dictionary, so modifying it from within the
|
<p>The module is given a copy of the original dictionary, so modifying it from within the
|
||||||
module cannot modify a user's profile when included in user directory search results.</p>
|
module cannot modify a user's profile when included in user directory search results.</p>
|
||||||
|
|
|
@ -8138,7 +8138,7 @@ callback that does not return <code>True</code> will be used. If this happens, S
|
||||||
any of the subsequent implementations of this callback.</p>
|
any of the subsequent implementations of this callback.</p>
|
||||||
<h3 id="check_username_for_spam"><a class="header" href="#check_username_for_spam"><code>check_username_for_spam</code></a></h3>
|
<h3 id="check_username_for_spam"><a class="header" href="#check_username_for_spam"><code>check_username_for_spam</code></a></h3>
|
||||||
<p><em>First introduced in Synapse v1.37.0</em></p>
|
<p><em>First introduced in Synapse v1.37.0</em></p>
|
||||||
<pre><code class="language-python">async def check_username_for_spam(user_profile: Dict[str, str]) -> bool
|
<pre><code class="language-python">async def check_username_for_spam(user_profile: synapse.module_api.UserProfile) -> bool
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<p>Called when computing search results in the user directory. The module must return a
|
<p>Called when computing search results in the user directory. The module must return a
|
||||||
<code>bool</code> indicating whether the given user should be excluded from user directory
|
<code>bool</code> indicating whether the given user should be excluded from user directory
|
||||||
|
@ -8146,9 +8146,11 @@ searches. Return <code>True</code> to indicate that the user is spammy and exclu
|
||||||
search results; otherwise return <code>False</code>.</p>
|
search results; otherwise return <code>False</code>.</p>
|
||||||
<p>The profile is represented as a dictionary with the following keys:</p>
|
<p>The profile is represented as a dictionary with the following keys:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><code>user_id</code>: The Matrix ID for this user.</li>
|
<li><code>user_id: str</code>. The Matrix ID for this user.</li>
|
||||||
<li><code>display_name</code>: The user's display name.</li>
|
<li><code>display_name: Optional[str]</code>. The user's display name, or <code>None</code> if this user
|
||||||
<li><code>avatar_url</code>: The <code>mxc://</code> URL to the user's avatar.</li>
|
has not set a display name.</li>
|
||||||
|
<li><code>avatar_url: Optional[str]</code>. The <code>mxc://</code> URL to the user's avatar, or <code>None</code>
|
||||||
|
if this user has not set an avatar.</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>The module is given a copy of the original dictionary, so modifying it from within the
|
<p>The module is given a copy of the original dictionary, so modifying it from within the
|
||||||
module cannot modify a user's profile when included in user directory search results.</p>
|
module cannot modify a user's profile when included in user directory search results.</p>
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue