RedReader icon indicating copy to clipboard operation
RedReader copied to clipboard

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

Open folkemat opened this issue 1 year ago • 4 comments

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 avatar Jan 06 '24 03:01 folkemat

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 avatar Jan 14 '24 19:01 QuantumBadger

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

QuantumBadger avatar Jan 14 '24 19:01 QuantumBadger

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?

folkemat avatar Jan 15 '24 05:01 folkemat

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 avatar Jan 21 '24 18:01 QuantumBadger

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

QuantumBadger avatar Mar 24 '24 14:03 QuantumBadger