Treat only true and "true" as true
authorMaxim Filippov <colixer@gmail.com>
Thu, 27 Dec 2018 10:21:04 +0000 (13:21 +0300)
committerMaxim Filippov <colixer@gmail.com>
Thu, 27 Dec 2018 10:21:04 +0000 (13:21 +0300)
lib/pleroma/web/common_api/common_api.ex
lib/pleroma/web/common_api/utils.ex

index 5e58215616872b1a5f754bbca42278f7e8b80f48..085a951726ee51943211327e1ee3e61e35406f53 100644 (file)
@@ -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"],
index d9cc52e26f06ddf2e8ac934fd23244e5afec8b38..b91cfc4bb89e97b6fd7a2e21872079ca1427722e 100644 (file)
@@ -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