diff options
author | rinpatch <rinpatch@sdf.org> | 2020-04-01 12:55:52 +0000 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2020-04-01 12:55:52 +0000 |
commit | bfec45bf740f9fcfcea92bbded6bd2c146dc64c1 (patch) | |
tree | 0824aa5563a55264b196a0a24b1270c70dd2dc85 /lib/pleroma/web/metadata | |
parent | c9f51edea12599cd0384b0f23d5aba8465c6a865 (diff) | |
parent | 94ddbe4098e167f9537d168261a6cc76fa17508b (diff) | |
download | pleroma-bfec45bf740f9fcfcea92bbded6bd2c146dc64c1.tar.gz |
Merge branch 'fix/1601-add-new-meta-tag' into 'develop'
Restrict remote users from indexing
Closes #1601
See merge request pleroma/pleroma!2341
Diffstat (limited to 'lib/pleroma/web/metadata')
-rw-r--r-- | lib/pleroma/web/metadata/restrict_indexing.ex | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/pleroma/web/metadata/restrict_indexing.ex b/lib/pleroma/web/metadata/restrict_indexing.ex new file mode 100644 index 000000000..f15607896 --- /dev/null +++ b/lib/pleroma/web/metadata/restrict_indexing.ex @@ -0,0 +1,25 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/> +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.Web.Metadata.Providers.RestrictIndexing do + @behaviour Pleroma.Web.Metadata.Providers.Provider + + @moduledoc """ + Restricts indexing of remote users. + """ + + @impl true + def build_tags(%{user: %{local: false}}) do + [ + {:meta, + [ + name: "robots", + content: "noindex, noarchive" + ], []} + ] + end + + @impl true + def build_tags(%{user: %{local: true}}), do: [] +end |