aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/common_api
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2020-02-11 15:39:19 -0600
committerMark Felder <feld@FreeBSD.org>2020-02-11 15:39:19 -0600
commitff9fd4ca895563178e3174fdc86d866508c5a9fa (patch)
tree455c352b27b87654ba92b7cd6c87a544deeda290 /lib/pleroma/web/common_api
parentd056f7f722b5e734ac53d8b55a0228174d64cc9f (diff)
downloadpleroma-ff9fd4ca895563178e3174fdc86d866508c5a9fa.tar.gz
Fix the confusingly named and inverted logic of "no_attachment_links"
The setting is now simply "attachment_links" and the boolean value does what you expect. A double negative is never possible and describing the functionality is no longer a philospher's worst nightmare.
Diffstat (limited to 'lib/pleroma/web/common_api')
-rw-r--r--lib/pleroma/web/common_api/utils.ex8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/pleroma/web/common_api/utils.ex b/lib/pleroma/web/common_api/utils.ex
index ca6c93862..4445894b0 100644
--- a/lib/pleroma/web/common_api/utils.ex
+++ b/lib/pleroma/web/common_api/utils.ex
@@ -228,9 +228,9 @@ defmodule Pleroma.Web.CommonAPI.Utils do
data,
visibility
) do
- no_attachment_links =
+ attachment_links =
data
- |> Map.get("no_attachment_links", Config.get([:instance, :no_attachment_links]))
+ |> Map.get("attachment_links", Config.get([:instance, :attachment_links]))
|> truthy_param?()
content_type = get_content_type(data["content_type"])
@@ -244,7 +244,7 @@ defmodule Pleroma.Web.CommonAPI.Utils do
status
|> format_input(content_type, options)
- |> maybe_add_attachments(attachments, no_attachment_links)
+ |> maybe_add_attachments(attachments, attachment_links)
|> maybe_add_nsfw_tag(data)
end
@@ -270,7 +270,7 @@ defmodule Pleroma.Web.CommonAPI.Utils do
def make_context(%Activity{data: %{"context" => context}}, _), do: context
def make_context(_, _), do: Utils.generate_context_id()
- def maybe_add_attachments(parsed, _attachments, true = _no_links), do: parsed
+ def maybe_add_attachments(parsed, _attachments, false = _no_links), do: parsed
def maybe_add_attachments({text, mentions, tags}, attachments, _no_links) do
text = add_attachments(text, attachments)