summary refs log tree commit diff
path: root/latest/modules/spam_checker_callbacks.html
diff options
context:
space:
mode:
authorsquahtx <squahtx@users.noreply.github.com>2022-04-05 14:15:14 +0000
committersquahtx <squahtx@users.noreply.github.com>2022-04-05 14:15:14 +0000
commit520cf4ab2ca7474a6cce67531b305ed0fee20548 (patch)
treeb2fd9a03fc8240209c8413c72688c530b4e0c2e7 /latest/modules/spam_checker_callbacks.html
parentdeploy: 708d88b1a22d422c294c4d06f2896a24f2a0251d (diff)
downloadsynapse-520cf4ab2ca7474a6cce67531b305ed0fee20548.tar.xz
deploy: ac80bfba4252c3bb8138cc3711271be63182eed8
Diffstat (limited to 'latest/modules/spam_checker_callbacks.html')
-rw-r--r--latest/modules/spam_checker_callbacks.html10
1 files changed, 6 insertions, 4 deletions
diff --git a/latest/modules/spam_checker_callbacks.html b/latest/modules/spam_checker_callbacks.html

index 3ffd3b584b..13165129c0 100644 --- a/latest/modules/spam_checker_callbacks.html +++ b/latest/modules/spam_checker_callbacks.html
@@ -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> <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> -<pre><code class="language-python">async def check_username_for_spam(user_profile: Dict[str, str]) -&gt; bool +<pre><code class="language-python">async def check_username_for_spam(user_profile: synapse.module_api.UserProfile) -&gt; bool </code></pre> <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 @@ -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> <p>The profile is represented as a dictionary with the following keys:</p> <ul> -<li><code>user_id</code>: The Matrix ID for this user.</li> -<li><code>display_name</code>: The user's display name.</li> -<li><code>avatar_url</code>: The <code>mxc://</code> URL to the user's avatar.</li> +<li><code>user_id: str</code>. The Matrix ID for this user.</li> +<li><code>display_name: Optional[str]</code>. The user's display name, or <code>None</code> if this user +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> <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>