diff options
| author | William Pitcock <nenolod@dereferenced.org> | 2019-05-17 20:42:51 +0000 | 
|---|---|---|
| committer | William Pitcock <nenolod@dereferenced.org> | 2019-05-17 22:13:24 +0000 | 
| commit | dc081595385084fe6b382e4b38c17cb51cf0a611 (patch) | |
| tree | f17053b71f9ce5a597c5baf6b2ae9538c5e6d716 /lib | |
| parent | 0da1233e8e093ff7c69994f9e81d58611be60507 (diff) | |
| download | pleroma-dc081595385084fe6b382e4b38c17cb51cf0a611.tar.gz pleroma-dc081595385084fe6b382e4b38c17cb51cf0a611.zip | |
also suppress link previews from posts marked #nsfw
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/pleroma/web/common_api/common_api.ex | 4 | ||||
| -rw-r--r-- | lib/pleroma/web/common_api/utils.ex | 4 | 
2 files changed, 6 insertions, 2 deletions
| diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex index a599ffee5..5a312d673 100644 --- a/lib/pleroma/web/common_api/common_api.ex +++ b/lib/pleroma/web/common_api/common_api.ex @@ -157,6 +157,7 @@ defmodule Pleroma.Web.CommonAPI do           {to, cc} <- to_for_user_and_mentions(user, mentions, in_reply_to, visibility),           context <- make_context(in_reply_to),           cw <- data["spoiler_text"] || "", +         sensitive <- data["sensitive"] || Enum.member?(tags, {"#nsfw", "nsfw"}),           full_payload <- String.trim(status <> cw),           length when length in 1..limit <- String.length(full_payload),           object <- @@ -169,7 +170,8 @@ defmodule Pleroma.Web.CommonAPI do               in_reply_to,               tags,               cw, -             cc +             cc, +             sensitive             ),           object <-             Map.put( diff --git a/lib/pleroma/web/common_api/utils.ex b/lib/pleroma/web/common_api/utils.ex index bee2fd159..8d6160976 100644 --- a/lib/pleroma/web/common_api/utils.ex +++ b/lib/pleroma/web/common_api/utils.ex @@ -223,7 +223,8 @@ defmodule Pleroma.Web.CommonAPI.Utils do          in_reply_to,          tags,          cw \\ nil, -        cc \\ [] +        cc \\ [], +        sensitive \\ false        ) do      object = %{        "type" => "Note", @@ -231,6 +232,7 @@ defmodule Pleroma.Web.CommonAPI.Utils do        "cc" => cc,        "content" => content_html,        "summary" => cw, +      "sensitive" => sensitive,        "context" => context,        "attachment" => attachments,        "actor" => actor, | 
