diff --git a/lib/pleroma/web/activity_pub/object_validator.ex b/lib/pleroma/web/activity_pub/object_validator.ex index 6e40d8b72..0c0af2394 100644 --- a/lib/pleroma/web/activity_pub/object_validator.ex +++ b/lib/pleroma/web/activity_pub/object_validator.ex @@ -143,7 +143,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidator do def validate(%{"type" => type} = object, meta) when type in ~w[Accept Reject Follow Update Like EmojiReact Announce - ChatMessage Answer] do + ChatMessage Answer Add Remove] do validator = case type do "Accept" -> AcceptRejectValidator @@ -155,6 +155,8 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidator do "Announce" -> AnnounceValidator "ChatMessage" -> ChatMessageValidator "Answer" -> AnswerValidator + "Add" -> AddRemoveValidator + "Remove" -> AddRemoveValidator end with {:ok, object} <- @@ -166,16 +168,6 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidator do end end - def validate(%{"type" => type} = object, meta) when type in ~w(Add Remove) do - with {:ok, object} <- - object - |> AddRemoveValidator.cast_and_validate() - |> Ecto.Changeset.apply_action(:insert) do - object = stringify_keys(object) - {:ok, object, meta} - end - end - def validate(o, m), do: {:error, {:validator_not_set, {o, m}}} def cast_and_apply(%{"type" => "ChatMessage"} = object) do