diff options
author | Alex Gleason <alex@alexgleason.me> | 2021-04-29 11:14:32 -0500 |
---|---|---|
committer | Alex Gleason <alex@alexgleason.me> | 2021-04-29 11:14:32 -0500 |
commit | 762be6ce10d2145e8e31d42c5d1a0bab93dbe7b0 (patch) | |
tree | 0416ef7020ba2b333cb223200d7108928f714fde /lib/pleroma/web/common_api/utils.ex | |
parent | b7b05a074867c1444dd539d6d2331f6d5504f6e6 (diff) | |
parent | 115673bce773f91630c3bd4fd2d0023f92bee163 (diff) | |
download | pleroma-762be6ce10d2145e8e31d42c5d1a0bab93dbe7b0.tar.gz |
Merge remote-tracking branch 'upstream/develop' into block-behavior
Diffstat (limited to 'lib/pleroma/web/common_api/utils.ex')
-rw-r--r-- | lib/pleroma/web/common_api/utils.ex | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/pleroma/web/common_api/utils.ex b/lib/pleroma/web/common_api/utils.ex index 1c74ea787..4e6a3feb0 100644 --- a/lib/pleroma/web/common_api/utils.ex +++ b/lib/pleroma/web/common_api/utils.ex @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/> +# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/> # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.CommonAPI.Utils do @@ -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 @@ -319,7 +311,7 @@ defmodule Pleroma.Web.CommonAPI.Utils do defp add_in_reply_to(object, nil), do: object defp add_in_reply_to(object, in_reply_to) do - with %Object{} = in_reply_to_object <- Object.normalize(in_reply_to) do + with %Object{} = in_reply_to_object <- Object.normalize(in_reply_to, fetch: false) do Map.put(object, "inReplyTo", in_reply_to_object.data["id"]) else _ -> object @@ -399,7 +391,7 @@ defmodule Pleroma.Web.CommonAPI.Utils do %Activity{data: %{"to" => _to, "type" => type} = data} = activity ) when type == "Create" do - object = Object.normalize(activity, false) + object = Object.normalize(activity, fetch: false) object_data = cond do |