Treat only true and "true" as true

This commit is contained in:
Maxim Filippov 2018-12-27 13:21:04 +03:00
parent 838c024231
commit be70272ab0
2 changed files with 2 additions and 2 deletions

View file

@ -102,7 +102,7 @@ def post(user, %{"status" => status} = data) do
attachments, attachments,
tags, tags,
get_content_type(data["content_type"]), get_content_type(data["content_type"]),
data["no_attachment_links"] Enum.member?([true, "true"], data["no_attachment_links"])
), ),
context <- make_context(inReplyTo), context <- make_context(inReplyTo),
cw <- data["spoiler_text"], cw <- data["spoiler_text"],

View file

@ -89,7 +89,7 @@ def make_content_html(
) do ) do
status status
|> format_input(mentions, tags, content_type) |> format_input(mentions, tags, content_type)
|> maybe_add_attachments(attachments, !!no_attachment_links) |> maybe_add_attachments(attachments, no_attachment_links)
end end
def make_context(%Activity{data: %{"context" => context}}), do: context def make_context(%Activity{data: %{"context" => context}}), do: context