Move object internal fields to a constant
This commit is contained in:
parent
b9cdead076
commit
845e8ad5f6
2 changed files with 13 additions and 9 deletions
|
@ -6,4 +6,16 @@ defmodule Pleroma.Constants do
|
||||||
use Const
|
use Const
|
||||||
|
|
||||||
const(as_public, do: "https://www.w3.org/ns/activitystreams#Public")
|
const(as_public, do: "https://www.w3.org/ns/activitystreams#Public")
|
||||||
|
|
||||||
|
const(object_internal_fields,
|
||||||
|
do: [
|
||||||
|
"likes",
|
||||||
|
"like_count",
|
||||||
|
"announcements",
|
||||||
|
"announcement_count",
|
||||||
|
"emoji",
|
||||||
|
"context_id",
|
||||||
|
"deleted_activity_id"
|
||||||
|
]
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
|
@ -997,15 +997,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
||||||
|
|
||||||
defp strip_internal_fields(object) do
|
defp strip_internal_fields(object) do
|
||||||
object
|
object
|
||||||
|> Map.drop([
|
|> Map.drop(Pleroma.Constants.object_internal_fields())
|
||||||
"likes",
|
|
||||||
"like_count",
|
|
||||||
"announcements",
|
|
||||||
"announcement_count",
|
|
||||||
"emoji",
|
|
||||||
"context_id",
|
|
||||||
"deleted_activity_id"
|
|
||||||
])
|
|
||||||
end
|
end
|
||||||
|
|
||||||
defp strip_internal_tags(%{"tag" => tags} = object) do
|
defp strip_internal_tags(%{"tag" => tags} = object) do
|
||||||
|
|
Loading…
Reference in a new issue