mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
SiteSetting to hide regular names from users
This commit is contained in:
@@ -31,4 +31,8 @@ class BasicPostSerializer < ApplicationSerializer
|
||||
end
|
||||
end
|
||||
|
||||
def include_name?
|
||||
SiteSetting.enable_names?
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -112,7 +112,6 @@ class PostSerializer < BasicPostSerializer
|
||||
def reply_to_user
|
||||
{
|
||||
username: object.reply_to_user.username,
|
||||
name: object.reply_to_user.name,
|
||||
avatar_template: object.reply_to_user.avatar_template
|
||||
}
|
||||
end
|
||||
@@ -194,6 +193,10 @@ class PostSerializer < BasicPostSerializer
|
||||
post_actions.present? && post_actions.keys.include?(PostActionType.types[:bookmark])
|
||||
end
|
||||
|
||||
def include_display_username?
|
||||
SiteSetting.enable_names?
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def post_actions
|
||||
|
||||
@@ -92,4 +92,8 @@ class UserSerializer < BasicUserSerializer
|
||||
User.gravatar_template(object.email)
|
||||
end
|
||||
|
||||
def include_name?
|
||||
SiteSetting.enable_names?
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user