1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.ActivityPub.MRF.MentionPolicy do
6 @moduledoc "Block messages which mention a user"
8 @behaviour Pleroma.Web.ActivityPub.MRF
11 def filter(%{"type" => "Create"} = message) do
12 reject_actors = Pleroma.Config.get([:mrf_mention, :actors], [])
13 recipients = (message["to"] || []) ++ (message["cc"] || [])
15 if Enum.any?(recipients, fn recipient -> Enum.member?(reject_actors, recipient) end) do
23 def filter(message), do: {:ok, message}
26 def describe, do: {:ok, %{}}