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

[bugfix] Allow blocked accounts to show in precise search #2321

Merged
merged 1 commit into from
Oct 30, 2023

Conversation

tsmethurst
Copy link
Contributor

@tsmethurst tsmethurst commented Oct 30, 2023

Description

If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.

If this is a documentation change, please briefly describe what you've changed and why.

This pull request updates the search implementation to allow showing accounts in results that have been blocked by the searcher, but ONLY if the search query is specific enough that it's unmistakeably the blocked account that's being searched for.

Previously we were a bit too strict in our visibility checking, so if you blocked someone and wanted to unblock them, you couldn't just search for them and click unblock, you had to either go through your notifications, or mentions, or whatever, looking for the person so you could open their profile and click unblock on them.

Blocked accounts will still not be shown in more general search results.

Also does a little quality-of-life stuff:

  • show generic avatars for blocked accounts, so that looking through all the accounts one has blocked doesn't just show empty avatars.
  • return empty status slice rather than 404 when trying to view statuses of a blocked account (avoids errors in clients like pinafore)

closes #2255

Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: [ ] -> [x]

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

  • I/we have read the GoToSocial contribution guidelines.
  • I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
  • I/we have performed a self-review of added code.
  • I/we have written code that is legible and maintainable by others.
  • I/we have commented the added code, particularly in hard-to-understand areas.
  • I/we have made any necessary changes to documentation.
  • I/we have added tests that cover new code.
  • I/we have run tests and they pass locally with the changes.
  • I/we have run go fmt ./... and golangci-lint run.

@tsmethurst tsmethurst merged commit dd4b024 into main Oct 30, 2023
@tsmethurst tsmethurst deleted the allow_search_blocked_accounts branch October 30, 2023 18:01
@mirabilos
Copy link
Contributor

Sorry this is too late, but would it be a good idea to take one of the generic avatars, overlay a 🚫 on top of it, saving that under a separate name, and using that? Since you already touched the avatar logic for this.

No worries if you’d rather not, just a quick idea.

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.

[bug] Impossible to search for a blocked user
2 participants