X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fmetadata.ex;h=c9aac27dca207aef7f2cbe3915d9991009798076;hb=a6283bbae13a873af969336bd4e62011777a1a70;hp=2164b0fe866d89ddbb99b4817e76b4f83aa0b243;hpb=5fa508cc2be6a8e5b4d6522687708c6c269803a3;p=akkoma
diff --git a/lib/pleroma/web/metadata.ex b/lib/pleroma/web/metadata.ex
index 2164b0fe8..c9aac27dc 100644
--- a/lib/pleroma/web/metadata.ex
+++ b/lib/pleroma/web/metadata.ex
@@ -1,6 +1,7 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
+
defmodule Pleroma.Web.Metadata do
alias Phoenix.HTML
@@ -28,4 +29,12 @@ defmodule Pleroma.Web.Metadata do
raise ArgumentError, message: "make_tag invalid args"
end
end
+
+ def activity_nsfw?(%{data: %{"sensitive" => sensitive}}) do
+ Pleroma.Config.get([__MODULE__, :unfurl_nsfw], false) == false and sensitive
+ end
+
+ def activity_nsfw?(_) do
+ false
+ end
end