element-hq / element-hq/synapse

Add User ID of the person who Initiated the search, as a parameter to the callback method check_username_for_spam in spam checker ModuleAPI

Open
#16,884 1 comment 0 reactions 0 assignees View on GitHub
A-Modules O-Uncommon T-Enhancement
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

**Description:**

Currently, the callback method for check_username_for_spam does not include the user ID of the person who initiated the search as a parameter. This limitation hinders our ability to filter search result effectively and restrict user visibility based on who initiated the search.

To address this issue, we suggest adding a user ID parameter to the callback method. This will allow us to associate the spam username check results and search results with the corresponding user IDs, enabling us to implement more effective spam prevention measures and user visibility controls.

You can find the relevant code that calls the check_username_for_spam method in the user_directory.py file at the following location: [user_directory.py#L160-L167](https://github.com/element-hq/synapse/blob/23740eaa3da94fbe2e25180376961979fc4e8cd3/synapse/handlers/user_directory.py#L160-L167).

This enhancement may require updating documentation and deprecating the old callback method.

Additionally, we would like to request the following changes:

1. Deprecation of the original callback: Please mark the original callback method as deprecated in the documentation, but do not remove it from the codebase.2.
2. Rename the new callback: As the original name "check_username_for_spam" does not accurately reflect the fact that a full user profile is provided, we suggest renaming the new callback to "check_user_profile_for_spam" to better align with its functionality.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.