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

Ability to block and unblock users, hide or flag comments from blocked users, show a blocked chip in profile #1163

Merged
merged 6 commits into from
Mar 24, 2024

Conversation

folkemat
Copy link
Contributor

@folkemat folkemat commented Jan 6, 2024

Hi, this PR copies most of the dead/inactive pull request 940 with some changes.

  • "Hide comment chains from blocked users" is enabled by default
  • If disabled, "[blocked]" is added to the author and the comment collapses
  • A "Blocked" chip is displayed in the profile of blocked users
  • Users can be blocked via a "Block" button in the profile
  • Users can be unblocked via a "Unblock" button in the profile

@folkemat folkemat changed the title Hide or flag comments from blocked users, show a blocked chip in profile Ability to block and unblock users, hide or flag comments from blocked users, show a blocked chip in profile Jan 8, 2024
@QuantumBadger
Copy link
Owner

Thanks for this, it mostly looks good! Some comments:

  • The "Block" option is shown on the user profile even if the user is logged out.
  • It would be good to improve the error message shown to users when they need to re-login. Specifically, we should:
    • Detect when Reddit sends a 403 permission error when blocking
    • If it's a 403, show a dialog saying the user must re-login, with a "re-login" button taking them to the OAuthLoginActivity. It shouldn't be necessary to log out -- simply going through the login process should get a new token.
    • If it's not a 403, show a standard error dialog that doesn't mention logging in again.
  • When the block operation is in progress, the "Blocking..." chip should be greyed out

If you have any questions please let me know!

@QuantumBadger
Copy link
Owner

Also I've fixed the CI failure in master (it was caused by a runner upgrade), so rebasing should fix the build failure.

@folkemat
Copy link
Contributor Author

I have implemented all your good ideas:

  • Block button is now no longer displayed when anonymous.
  • I had a hard time with the re-login thing and figuring out how OAuthLoginActivity works, but I think it should all work now: In case of error 403, a custom permission error dialog appears with a re-login option that performs a new login that sets a new token
  • Standard error dialogue if it is not error 403.
  • (Un)Blocking... is greyed out.
  • Reworked the strings.

Android Lint and Unit tests are failing for some plugin error, I don't think this has something to do with my changes?

@QuantumBadger
Copy link
Owner

Thanks for making the changes @folkemat! I'll get this merged in soon. Not sure what's causing the CI failures, I'll investigate.

@QuantumBadger QuantumBadger merged commit d2ed07f into QuantumBadger:master Mar 24, 2024
1 check passed
@QuantumBadger
Copy link
Owner

@folkemat Thanks again, I've merged this in, sorry about the long delay! Changelog also updated.

QuantumBadger added a commit that referenced this pull request Mar 24, 2024
@QuantumBadger QuantumBadger mentioned this pull request May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants