Merge branch 'fix/remove_auto_nsfw' into 'develop'

Remove sensitive setting #nsfw

See merge request pleroma/pleroma!3223
This commit is contained in:
rinpatch 2021-03-19 08:48:22 +00:00
commit f930e83fa2
15 changed files with 187 additions and 62 deletions

View file

@ -179,7 +179,7 @@ defmodule Pleroma.Web.CommonAPI.ActivityDraft do
end
defp sensitive(draft) do
sensitive = draft.params[:sensitive] || Enum.member?(draft.tags, {"#nsfw", "nsfw"})
sensitive = draft.params[:sensitive]
%__MODULE__{draft | sensitive: sensitive}
end

View file

@ -217,7 +217,6 @@ defmodule Pleroma.Web.CommonAPI.Utils do
draft.status
|> format_input(content_type, options)
|> maybe_add_attachments(draft.attachments, attachment_links)
|> maybe_add_nsfw_tag(draft.params)
end
defp get_content_type(content_type) do
@ -228,13 +227,6 @@ defmodule Pleroma.Web.CommonAPI.Utils do
end
end
defp maybe_add_nsfw_tag({text, mentions, tags}, %{"sensitive" => sensitive})
when sensitive in [true, "True", "true", "1"] do
{text, mentions, [{"#nsfw", "nsfw"} | tags]}
end
defp maybe_add_nsfw_tag(data, _), do: data
def make_context(_, %Participation{} = participation) do
Repo.preload(participation, :conversation).conversation.ap_id
end