Merge branch 'feature/as2-page-support' into 'develop'

AS2 page support (prismo)

See merge request pleroma/pleroma!413
This commit is contained in:
kaniini 2018-11-01 10:48:09 +00:00
commit 4fab4e9ba4
4 changed files with 4 additions and 4 deletions

View File

@ -263,7 +263,7 @@ def handle_incoming(%{"id" => id}) when not (is_binary(id) and length(id) > 8),
# - tags # - tags
# - emoji # - emoji
def handle_incoming(%{"type" => "Create", "object" => %{"type" => objtype} = object} = data) def handle_incoming(%{"type" => "Create", "object" => %{"type" => objtype} = object} = data)
when objtype in ["Article", "Note", "Video"] do when objtype in ["Article", "Note", "Video", "Page"] do
actor = get_actor(data) actor = get_actor(data)
data = data =

View File

@ -175,7 +175,7 @@ def lazy_put_object_defaults(map, activity \\ %{}) do
Inserts a full object if it is contained in an activity. Inserts a full object if it is contained in an activity.
""" """
def insert_full_object(%{"object" => %{"type" => type} = object_data}) def insert_full_object(%{"object" => %{"type" => type} = object_data})
when is_map(object_data) and type in ["Article", "Note", "Video"] do when is_map(object_data) and type in ["Article", "Note", "Video", "Page"] do
with {:ok, _} <- Object.create(object_data) do with {:ok, _} <- Object.create(object_data) do
:ok :ok
end end

View File

@ -236,7 +236,7 @@ def render_content(%{"type" => "Video"} = object) do
content content
end end
def render_content(%{"type" => "Article"} = object) do def render_content(%{"type" => object_type} = object) when object_type in ["Article", "Page"] do
summary = object["name"] summary = object["name"]
content = content =

View File

@ -283,7 +283,7 @@ def render_content(%{"type" => "Note"} = object) do
{summary, content} {summary, content}
end end
def render_content(%{"type" => "Article"} = object) do def render_content(%{"type" => object_type} = object) when object_type in ["Article", "Page"] do
summary = object["name"] || object["summary"] summary = object["name"] || object["summary"]
content = content =