Questions: Move fixes to validators.
This commit is contained in:
parent
b5f0cef156
commit
f889400d05
4 changed files with 29 additions and 15 deletions
|
|
@ -634,17 +634,10 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
|||
end
|
||||
|
||||
def handle_incoming(
|
||||
%{"type" => "Create", "object" => %{"type" => objtype} = object} = data,
|
||||
%{"type" => "Create", "object" => %{"type" => objtype}} = data,
|
||||
_options
|
||||
)
|
||||
when objtype in ["Question", "Answer"] do
|
||||
data =
|
||||
data
|
||||
|> Map.put("object", fix_object(object))
|
||||
|> fix_addressing()
|
||||
|
||||
data = Map.put_new(data, "context", data["object"]["context"])
|
||||
|
||||
when objtype in ["Question", "Answer", "ChatMessage"] do
|
||||
with {:ok, %User{}} <- ObjectValidator.fetch_actor(data),
|
||||
{:ok, activity, _} <- Pipeline.common_pipeline(data, local: false) do
|
||||
{:ok, activity}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue