Phuks-co / throat

Open Source link aggregator and discussion platform powering Phuks
https://phuks.co
MIT License
74 stars 32 forks source link

Allow users to block each others' content as well as messages #396

Closed happy-river closed 3 years ago

happy-river commented 3 years ago

Allow users to block content from other users separately from blocking private messages. Resolves #325.

Rename the UserIgnores model to UserMessageBlock and add a new model, UserContentBlock to record user blocking relationships. UserContentBlock allows two levels of blocking, hide-blocking and blur-blocking.

Hide-blocking removes posts from lists (except when viewing the blocked user's post list from their profile) and collapses comments and replaces the content of the comment, when you expand it, with a note saying the user is blocked.

Blur-blocking blurs posts in lists (except when viewing the blocked user's post list from their profile), adding a red color to the blur to make it visually distinct from NSFW blur. It collapses comments, but when you expand the comment you can see the content. Blur-blocking is not implemented on the Recent Activity lists, so content from users you have blur-blocked will be removed from that list. You will not see notifications from hide-blocked or blur-blocked users.

Disable the block feature for admins, and don't let anyone block an admin. Users can block content from mods, but they will still see mod content when they are looking at the mod's sub and get moderation-related notifications from the blocked mod. Mods can block other users, but content blocking will not work when mods are looking at content in their own subs.

Update the Blocked Users page to allow editing both kinds of blocking, and add pagination. Make the Blocked Users page appear in the sidebar of both a user's notifications pages and the user's profile. Add a Block option to the sidebar when viewing another user's profile, which brings up a modal allowing you to edit the block settings for that user.

Remove the "block" link from the Notifications page. Add tests for notifications.