diff options
author | DMRobertson <DMRobertson@users.noreply.github.com> | 2022-03-18 13:52:14 +0000 |
---|---|---|
committer | DMRobertson <DMRobertson@users.noreply.github.com> | 2022-03-18 13:52:14 +0000 |
commit | e051cb0543fdf0e13af222e52b16e2854c32e20c (patch) | |
tree | 69959237124a1ea24bb7194f92519706df704987 /develop/print.html | |
parent | deploy: 2fcf4b3f6cd2a0be6597622664636d2219957c2a (diff) | |
download | synapse-e051cb0543fdf0e13af222e52b16e2854c32e20c.tar.xz |
deploy: 872dbb0181714e201be082c4e8bd9b727c73f177
Diffstat (limited to 'develop/print.html')
-rw-r--r-- | develop/print.html | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/develop/print.html b/develop/print.html index 9558290e01..afb38086e2 100644 --- a/develop/print.html +++ b/develop/print.html @@ -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> <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]) -> bool +<pre><code class="language-python">async def check_username_for_spam(user_profile: synapse.module_api.UserProfile) -> 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 @@ -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> <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> |