- if actor_info.host in @media_nsfw and child_object["attachment"] != nil and
- length(child_object["attachment"]) > 0 do
- tags = (child_object["tag"] || []) ++ ["nsfw"]
- child_object = Map.put(child_object, "tags", tags)
- child_object = Map.put(child_object, "sensitive", true)
- object = Map.put(object, "object", child_object)
- end
+ defp check_media_nsfw(
+ %{host: actor_host} = _actor_info,
+ %{
+ "type" => "Create",
+ "object" => %{"attachment" => child_attachment} = child_object
+ } = object
+ )
+ when length(child_attachment) > 0 do
+ object =
+ if Enum.member?(Pleroma.Config.get([:mrf_simple, :media_nsfw]), actor_host) do
+ tags = (child_object["tag"] || []) ++ ["nsfw"]
+ child_object = Map.put(child_object, "tags", tags)
+ child_object = Map.put(child_object, "sensitive", true)
+ Map.put(object, "object", child_object)
+ else
+ object
+ end