diff options
author | eal <eal@waifu.club> | 2017-12-07 20:44:09 +0200 |
---|---|---|
committer | eal <eal@waifu.club> | 2017-12-07 20:44:09 +0200 |
commit | 5436dbaeaf0765c5d651cd16b02018edbc6793d4 (patch) | |
tree | dee526bc21bb8d1789246ee3dfd2fa0e63314c03 /lib/pleroma/web/common_api/utils.ex | |
parent | afd0ea37f3284bdfa6ddce99162601615b7ad845 (diff) | |
download | pleroma-5436dbaeaf0765c5d651cd16b02018edbc6793d4.tar.gz |
MastoAPI: don't add attachment links.
Diffstat (limited to 'lib/pleroma/web/common_api/utils.ex')
-rw-r--r-- | lib/pleroma/web/common_api/utils.ex | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/pleroma/web/common_api/utils.ex b/lib/pleroma/web/common_api/utils.ex index 1a23b1ad2..2d9fdaf6c 100644 --- a/lib/pleroma/web/common_api/utils.ex +++ b/lib/pleroma/web/common_api/utils.ex @@ -38,15 +38,19 @@ defmodule Pleroma.Web.CommonAPI.Utils do end end - def make_content_html(status, mentions, attachments, tags) do + def make_content_html(status, mentions, attachments, tags, no_attachment_links \\ false) do status |> format_input(mentions, tags) - |> add_attachments(attachments) + |> maybe_add_attachments(attachments, no_attachment_links) end def make_context(%Activity{data: %{"context" => context}}), do: context def make_context(_), do: Utils.generate_context_id + def maybe_add_attachments(text, attachments, _no_links = true), do: text + def maybe_add_attachments(text, attachments, _no_links) do + add_attachments(text, attachments) + end def add_attachments(text, attachments) do attachment_text = Enum.map(attachments, fn (%{"url" => [%{"href" => href} | _]}) -> |