Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Filter the results of user directory searching via the spam checker #6888

Merged
merged 9 commits into from
Feb 14, 2020

Conversation

clokep
Copy link
Member

@clokep clokep commented Feb 11, 2020

  • Adds a method to the spam checker with a user ID & display name and expects whether to display that user or not.
  • For backwards compatibility, if the method on the spam checker doesn't exist it is ignored.
  • Uses the above method in the user directory search to filter the responses.

Fixes #5648

@clokep clokep requested a review from a team February 11, 2020 15:00
synapse/events/spamcheck.py Outdated Show resolved Hide resolved
@clokep
Copy link
Member Author

clokep commented Feb 11, 2020

I think this probably needs another test or two (at least checking the backwards compatibility code-path).

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

looks good to me. A few nits and suggestions here. I think the only thing I really want changed is use of the term banned.

synapse/handlers/user_directory.py Outdated Show resolved Hide resolved
synapse/events/spamcheck.py Outdated Show resolved Hide resolved
synapse/events/spamcheck.py Outdated Show resolved Hide resolved
synapse/events/spamcheck.py Outdated Show resolved Hide resolved
synapse/events/spamcheck.py Outdated Show resolved Hide resolved
synapse/handlers/user_directory.py Outdated Show resolved Hide resolved
@richvdh
Copy link
Member

richvdh commented Feb 12, 2020

I'm also wondering if this is the right time to start a quick doc in https://github.com/matrix-org/synapse/blob/master/docs about what API the spam checker should implement is. WDYT?

@clokep
Copy link
Member Author

clokep commented Feb 12, 2020

Thanks for the comments @richvdh! I can certainly add a document about the spam checker too.

@clokep clokep requested a review from richvdh February 12, 2020 18:26
@clokep
Copy link
Member Author

clokep commented Feb 12, 2020

@richvdh I handle the review comments, my inclination is to do the documentation as a separate PR so that this doesn't block the actual need. Does that make sense?

@clokep
Copy link
Member Author

clokep commented Feb 12, 2020

See #6906 for the documentation. Note that it doesn't actually include the documentation for this PR. I'll either update that PR or this one based on which is merged first!

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

lgtm, though if @turt2live wants a profile dict, better give him one.

@clokep clokep force-pushed the clokep/filter-user-directory branch from caaa63b to 2be58bd Compare February 13, 2020 12:50
@clokep clokep requested review from richvdh and turt2live February 13, 2020 18:18
@clokep
Copy link
Member Author

clokep commented Feb 13, 2020

@turt2live / @richvdh I believe I've made all the requested changes, please take another look!

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.

lgtm from a design perspective. Will leave the Synapse bits to vdh/the synapse team.

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

lgtm too!

@clokep clokep merged commit 49f877d into develop Feb 14, 2020
@clokep clokep deleted the clokep/filter-user-directory branch February 14, 2020 12:17
babolivier pushed a commit that referenced this pull request Sep 1, 2021
…6888)

* commit '49f877d32':
  Filter the results of user directory searching via the spam checker (#6888)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants