Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an API to filter user directory searches by MXID or display name. #34

Merged
merged 4 commits into from
Feb 13, 2020

Conversation

clokep
Copy link
Member

@clokep clokep commented Feb 11, 2020

This would depend on matrix-org/synapse#6888 to be functional, it is likely worth taking a quick look at the API design in there first.

As noted in the synapse PR, I don't love the name of the chosen API method. Any suggestions would be appreciated!

I'm unsure if it makes sense to apply the same filtering (is_user_banned) over both the MXID and the display name, but it seemed like the simplest change to start with. What are your thoughts on this?

Related to matrix-org/synapse#5648.

@clokep clokep requested a review from turt2live February 11, 2020 15:12
Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise seems fine

synapse_antispam/mjolnir/antispam.py Outdated Show resolved Hide resolved
synapse_antispam/mjolnir/antispam.py Outdated Show resolved Hide resolved
@clokep clokep requested a review from turt2live February 13, 2020 18:18
@clokep
Copy link
Member Author

clokep commented Feb 13, 2020

I think I've hit all the comments here, please take another look!


# Check whether the user ID or display name matches any of the banned
# patterns.
return self.is_user_banned(user_profile["user_id"]) or self.is_user_banned(user_profile["display_name"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant to keep the user ID as its own arg, but this is fine too

@turt2live turt2live merged commit f6b4376 into master Feb 13, 2020
@turt2live turt2live deleted the clokep/filter-user-directory branch February 13, 2020 18:49
@clokep
Copy link
Member Author

clokep commented Feb 13, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants