2 changed files with 1 additions and 26 deletions
@ -1,26 +0,0 @@ |
|||
# Pleroma: A lightweight social networking server |
|||
# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/> |
|||
# SPDX-License-Identifier: AGPL-3.0-only |
|||
|
|||
defmodule Pleroma.Web.ActivityPub.MRF.UserDisallowListPolicy do |
|||
alias Pleroma.Config |
|||
|
|||
@behaviour Pleroma.Web.ActivityPub.MRF |
|||
|
|||
defp filter_by_list(object, []), do: {:ok, object} |
|||
|
|||
defp filter_by_list(object, disallow_list) do |
|||
cond do |
|||
Enum.any?(disallow_list, fn x -> x in object["to"] end) -> {:reject, nil} |
|||
Enum.any?(disallow_list, fn x -> x in object["cc"] end) -> {:reject, nil} |
|||
true -> {:ok, object} |
|||
end |
|||
end |
|||
|
|||
@impl true |
|||
def filter(object) do |
|||
disallow_list = Config.get([:mrf_user_disallowlist], []) |
|||
|
|||
filter_by_list(object, disallow_list) |
|||
end |
|||
end |
Loading…
Reference in new issue