mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
FEATURE: Add ignored user list to the User's preference page (#7107)
* FEATURE: Add ignored user list to the User's preference page ## Why? Part of: https://meta.discourse.org/t/ability-to-ignore-a-user/110254 We want to add list of Ignored users under or along with the muted users preferences section. This way Users can find and update their list of ignored users. ## UI  ## Open questions Two of many options to represent a list of ignored users is that we can: 1. We can represent the ignored user list as a table with the ability to `un-ignore` but NOT to add new ignored users. 2. We can keep it functioning as the `muted user list` where you can `un-ignore` or `ignore` users.
This commit is contained in:
@ -112,6 +112,7 @@ class UserSerializer < BasicUserSerializer
|
||||
:custom_avatar_template,
|
||||
:has_title_badges,
|
||||
:muted_usernames,
|
||||
:ignored_usernames,
|
||||
:mailing_list_posts_per_day,
|
||||
:can_change_bio,
|
||||
:user_api_keys,
|
||||
@ -377,6 +378,10 @@ class UserSerializer < BasicUserSerializer
|
||||
MutedUser.where(user_id: object.id).joins(:muted_user).pluck(:username)
|
||||
end
|
||||
|
||||
def ignored_usernames
|
||||
IgnoredUser.where(user_id: object.id).joins(:ignored_user).pluck(:username)
|
||||
end
|
||||
|
||||
def include_private_messages_stats?
|
||||
can_edit && !(omit_stats == true)
|
||||
end
|
||||
|
Reference in New Issue
Block a user