defp process_tag(_, message), do: {:ok, message}
@impl true
- def filter(%{"actor" => actor} = message) do
+ def filter(%{"object" => target_actor, "type" => "Follow"} = message) do
+ User.get_cached_by_ap_id(target_actor)
+ |> get_tags()
+ |> Enum.reduce({:ok, message}, fn
+ tag, {:ok, message} ->
+ process_tag(tag, message)
+
+ _, error ->
+ error
+ end)
+ end
+
+ @impl true
+ def filter(%{"actor" => actor, "type" => "Create"} = message) do
User.get_cached_by_ap_id(actor)
|> get_tags()
|> Enum.reduce({:ok, message}, fn
error
end)
end
+
+ @impl true
+ def filter(message), do: {:ok, message}
end