projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
TimelineController: Only return `Create` in public timelines.
[akkoma]
/
lib
/
pleroma
/
web
/
metadata.ex
diff --git
a/lib/pleroma/web/metadata.ex
b/lib/pleroma/web/metadata.ex
index 8793fc265ec76dcfe1a78eed1752c5602c1870a4..a9f70c43e32259b23b732eb5dc16c0124a17c00e 100644
(file)
--- a/
lib/pleroma/web/metadata.ex
+++ b/
lib/pleroma/web/metadata.ex
@@
-1,13
+1,17
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-20
19
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-20
20
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
# SPDX-License-Identifier: AGPL-3.0-only
+
defmodule Pleroma.Web.Metadata do
alias Phoenix.HTML
defmodule Pleroma.Web.Metadata do
alias Phoenix.HTML
- @providers Pleroma.Config.get([__MODULE__, :providers], [])
-
def build_tags(params) do
def build_tags(params) do
- Enum.reduce(@providers, "", fn parser, acc ->
+ providers = [
+ Pleroma.Web.Metadata.Providers.RestrictIndexing
+ | Pleroma.Config.get([__MODULE__, :providers], [])
+ ]
+
+ Enum.reduce(providers, "", fn parser, acc ->
rendered_html =
params
|> parser.build_tags()
rendered_html =
params
|> parser.build_tags()
@@
-30,4
+34,12
@@
defmodule Pleroma.Web.Metadata do
raise ArgumentError, message: "make_tag invalid args"
end
end
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
end