From e051cb0543fdf0e13af222e52b16e2854c32e20c Mon Sep 17 00:00:00 2001 From: DMRobertson Date: Fri, 18 Mar 2022 13:52:14 +0000 Subject: deploy: 872dbb0181714e201be082c4e8bd9b727c73f177 --- develop/modules/spam_checker_callbacks.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'develop/modules') diff --git a/develop/modules/spam_checker_callbacks.html b/develop/modules/spam_checker_callbacks.html index 3ffd3b584b..13165129c0 100644 --- a/develop/modules/spam_checker_callbacks.html +++ b/develop/modules/spam_checker_callbacks.html @@ -302,7 +302,7 @@ callback that does not return True will be used. If this happens, S any of the subsequent implementations of this callback.

check_username_for_spam

First introduced in Synapse v1.37.0

-
async def check_username_for_spam(user_profile: Dict[str, str]) -> bool
+
async def check_username_for_spam(user_profile: synapse.module_api.UserProfile) -> bool
 

Called when computing search results in the user directory. The module must return a bool indicating whether the given user should be excluded from user directory @@ -310,9 +310,11 @@ searches. Return True to indicate that the user is spammy and exclu search results; otherwise return False.

The profile is represented as a dictionary with the following keys:

    -
  • user_id: The Matrix ID for this user.
  • -
  • display_name: The user's display name.
  • -
  • avatar_url: The mxc:// URL to the user's avatar.
  • +
  • user_id: str. The Matrix ID for this user.
  • +
  • display_name: Optional[str]. The user's display name, or None if this user +has not set a display name.
  • +
  • avatar_url: Optional[str]. The mxc:// URL to the user's avatar, or None +if this user has not set an avatar.

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.

-- cgit 1.5.1