aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/common_api/utils.ex
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2019-03-20 21:09:36 +0100
committerlain <lain@soykaf.club>2019-03-20 21:09:36 +0100
commit8468f3f6d48693d2a27a257e5555aa71decff3df (patch)
tree9f61dcf50e315bba1842bda2e43d866adb7dbad7 /lib/pleroma/web/common_api/utils.ex
parent0d14def0ca781b79ffb3c1022472ac64f990cdf8 (diff)
downloadpleroma-8468f3f6d48693d2a27a257e5555aa71decff3df.tar.gz
Add safe dm mode option.
Diffstat (limited to 'lib/pleroma/web/common_api/utils.ex')
-rw-r--r--lib/pleroma/web/common_api/utils.ex12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/pleroma/web/common_api/utils.ex b/lib/pleroma/web/common_api/utils.ex
index b7513ef28..368945418 100644
--- a/lib/pleroma/web/common_api/utils.ex
+++ b/lib/pleroma/web/common_api/utils.ex
@@ -101,7 +101,8 @@ defmodule Pleroma.Web.CommonAPI.Utils do
def make_content_html(
status,
attachments,
- data
+ data,
+ visibility
) do
no_attachment_links =
data
@@ -110,8 +111,15 @@ defmodule Pleroma.Web.CommonAPI.Utils do
content_type = get_content_type(data["content_type"])
+ options =
+ if visibility == "direct" && Config.get([:instance, :safe_dm_mentions]) do
+ [safe_mention: true]
+ else
+ []
+ end
+
status
- |> format_input(content_type)
+ |> format_input(content_type, options)
|> maybe_add_attachments(attachments, no_attachment_links)
|> maybe_add_nsfw_tag(data)
end