Only add preferredUsername
to service actor json when the underlying user actually has a username
This commit is contained in:
parent
a187dbb326
commit
16cfb89240
1 changed files with 1 additions and 1 deletions
|
@ -45,7 +45,6 @@ def render("service.json", %{user: user}) do
|
|||
"following" => "#{user.ap_id}/following",
|
||||
"followers" => "#{user.ap_id}/followers",
|
||||
"inbox" => "#{user.ap_id}/inbox",
|
||||
"preferredUsername" => user.nickname,
|
||||
"name" => "Pleroma",
|
||||
"summary" =>
|
||||
"An internal service actor for this Pleroma instance. No user-serviceable parts inside.",
|
||||
|
@ -58,6 +57,7 @@ def render("service.json", %{user: user}) do
|
|||
},
|
||||
"endpoints" => endpoints
|
||||
}
|
||||
|> Map.merge(if user.nickname == nil do %{} else %{ "preferredUsername" => user.nickname})
|
||||
|> Map.merge(Utils.make_json_ld_header())
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue