From: Maxim Filippov Date: Thu, 27 Dec 2018 10:21:04 +0000 (+0300) Subject: Treat only true and "true" as true X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=be70272ab08356353ff3c2685dbb639477c2cdf4;p=akkoma Treat only true and "true" as true --- diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex index 5e5821561..085a95172 100644 --- a/lib/pleroma/web/common_api/common_api.ex +++ b/lib/pleroma/web/common_api/common_api.ex @@ -102,7 +102,7 @@ defmodule Pleroma.Web.CommonAPI do attachments, tags, get_content_type(data["content_type"]), - data["no_attachment_links"] + Enum.member?([true, "true"], data["no_attachment_links"]) ), context <- make_context(inReplyTo), cw <- data["spoiler_text"], diff --git a/lib/pleroma/web/common_api/utils.ex b/lib/pleroma/web/common_api/utils.ex index d9cc52e26..b91cfc4bb 100644 --- a/lib/pleroma/web/common_api/utils.ex +++ b/lib/pleroma/web/common_api/utils.ex @@ -89,7 +89,7 @@ defmodule Pleroma.Web.CommonAPI.Utils do ) do status |> format_input(mentions, tags, content_type) - |> maybe_add_attachments(attachments, !!no_attachment_links) + |> maybe_add_attachments(attachments, no_attachment_links) end def make_context(%Activity{data: %{"context" => context}}), do: context