Use consistent terminology
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
1e9333a9aa
commit
4f2fb8dc5e
|
@ -15,7 +15,7 @@ def render("show.json", _) do
|
||||||
|
|
||||||
common_information(instance)
|
common_information(instance)
|
||||||
|> Map.merge(%{
|
|> Map.merge(%{
|
||||||
uri: Pleroma.Web.WebFinger.domain(),
|
uri: Pleroma.Web.WebFinger.host(),
|
||||||
description: Keyword.get(instance, :description),
|
description: Keyword.get(instance, :description),
|
||||||
short_description: Keyword.get(instance, :short_description),
|
short_description: Keyword.get(instance, :short_description),
|
||||||
email: Keyword.get(instance, :email),
|
email: Keyword.get(instance, :email),
|
||||||
|
@ -49,7 +49,7 @@ def render("show2.json", _) do
|
||||||
|
|
||||||
common_information(instance)
|
common_information(instance)
|
||||||
|> Map.merge(%{
|
|> Map.merge(%{
|
||||||
domain: Pleroma.Web.WebFinger.domain(),
|
domain: Pleroma.Web.WebFinger.host(),
|
||||||
source_url: Pleroma.Application.repository(),
|
source_url: Pleroma.Application.repository(),
|
||||||
description: Keyword.get(instance, :short_description),
|
description: Keyword.get(instance, :short_description),
|
||||||
usage: %{users: %{active_month: Pleroma.User.active_user_count()}},
|
usage: %{users: %{active_month: Pleroma.User.active_user_count()}},
|
||||||
|
|
|
@ -70,7 +70,7 @@ defp gather_aliases(%User{} = user) do
|
||||||
|
|
||||||
def represent_user(user, "JSON") do
|
def represent_user(user, "JSON") do
|
||||||
%{
|
%{
|
||||||
"subject" => "acct:#{user.nickname}@#{domain()}",
|
"subject" => "acct:#{user.nickname}@#{host()}",
|
||||||
"aliases" => gather_aliases(user),
|
"aliases" => gather_aliases(user),
|
||||||
"links" => gather_links(user)
|
"links" => gather_links(user)
|
||||||
}
|
}
|
||||||
|
@ -90,13 +90,13 @@ def represent_user(user, "XML") do
|
||||||
:XRD,
|
:XRD,
|
||||||
%{xmlns: "http://docs.oasis-open.org/ns/xri/xrd-1.0"},
|
%{xmlns: "http://docs.oasis-open.org/ns/xri/xrd-1.0"},
|
||||||
[
|
[
|
||||||
{:Subject, "acct:#{user.nickname}@#{domain()}"}
|
{:Subject, "acct:#{user.nickname}@#{host()}"}
|
||||||
] ++ aliases ++ links
|
] ++ aliases ++ links
|
||||||
}
|
}
|
||||||
|> XmlBuilder.to_doc()
|
|> XmlBuilder.to_doc()
|
||||||
end
|
end
|
||||||
|
|
||||||
def domain do
|
def host do
|
||||||
Pleroma.Config.get([__MODULE__, :domain]) || Pleroma.Web.Endpoint.host()
|
Pleroma.Config.get([__MODULE__, :domain]) || Pleroma.Web.Endpoint.host()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue