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

Support for blacklisting a user network-wide #13994

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

CoconutMacaroon
Copy link
Contributor

@CoconutMacaroon CoconutMacaroon commented Jan 16, 2025

(List from here)

What does your pull request change or introduce to the project?

This PR resolves #6845 by adding support for blacklisting a user network-wide.

What is the justification for the inclusion of your Pull Request (or, what problem does it solve?)

See #6845.

Write meaningful commit messages [...]

I tried to, although I didn't include the why, seeing as it's here and in the linked issue.

Include comments in your code to help guide reviewers through what you intend for the sub-portions of your code to be doing. [...]

I've added some comments where it seemed appropriate.

Use meaningful variable names. [...]

I think I did, but I'm open to suggested changes (on anything here, of course, not just the variable names).

What testing have you done? [...]

I've updated some existing tests to handle the changed phrasing, although I haven't added tests to cover the added functionality. I've been testing my changes in this room, which includes the changes that don't have tests.


For this PR:

  • Adds the account ID to the Post class. It may be preferable to instead use the change(s) Makyen describes here instead.
  • Updates addblu and rmblu text to note a network-wide blacklist.
  • Change the isblu text based on if they're (a) on the site blacklist & (b) if they're on the network-wide blacklist
  • Add a note in the check_if_spam function - not sure if I did that correctly
  • Add a command to blacklist a user network-wide but given either a SE account link or a site profile link.

Not in this PR - these may be reasonable to implement; however, to reduce scope of this PR, I'm postponing them,

  • Have isblu should list site blacklists when checking a SE account - e.g., doing !!/isblu https://stackexchange.com/users/<someone> would also list and sites that <someone> blacklisted on
  • Change addblu and rmblu to note if a user is already network-wide blacklisted if changing a site blacklist

Note that I wasn't seeing the account_id with the existing filter,. I'm not sure why, so I changed it for testing, but I (or someone else) should investigate.

@CoconutMacaroon CoconutMacaroon marked this pull request as ready for review January 19, 2025 20:49
spamhandling.py Outdated Show resolved Hide resolved
@danthe1st
Copy link

I guess the new commands should be added to the wiki once this PR is merged.

@CoconutMacaroon
Copy link
Contributor Author

I guess the new commands should be added to the wiki once this PR is merged. - @danthe1st

How does this look?

!!/addnetblu <profile_URL> or !!/addnetblu <user_ID> <site_name> — Adds a user to the network-wide user-blacklist (this means that any post by this user, on any site, will be reported when scanned). Accepts either a site profile or a network profile.

!!/rmnetblu <profile_URL> or !!/rmnetblu <user_ID> <site_name> — Removes a user from the network-wide user-blacklist. Accepts either a site profile or a network profile.

@danthe1st
Copy link

This looks fine for me but I am not at all involved with maintaining anything in this repository at all.

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

Successfully merging this pull request may close these issues.

Allow blacklisting user across the network
2 participants