diff options
author | Egor Kislitsyn <egor@kislitsyn.com> | 2020-03-03 00:32:34 +0400 |
---|---|---|
committer | Egor Kislitsyn <egor@kislitsyn.com> | 2020-03-03 00:32:34 +0400 |
commit | 0f386110c6e15148ff1ff5ea3451885485fcb7ff (patch) | |
tree | 8a4dcbede6c674730980e1fafa5b956518170a14 /lib/pleroma/web/common_api/utils.ex | |
parent | 011ede45361096f55dda938078e24574cdf33b2b (diff) | |
parent | 4c02e049358441529c54a72cd11f1c81ee897d49 (diff) | |
download | pleroma-0f386110c6e15148ff1ff5ea3451885485fcb7ff.tar.gz |
Merge remote-tracking branch 'origin/develop' into global-status-expiration
Diffstat (limited to 'lib/pleroma/web/common_api/utils.ex')
-rw-r--r-- | lib/pleroma/web/common_api/utils.ex | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/pleroma/web/common_api/utils.ex b/lib/pleroma/web/common_api/utils.ex index ca6c93862..8746273c4 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-2019 Pleroma Authors <https://pleroma.social/> +# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/> # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.CommonAPI.Utils do @@ -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) |