squeaky otter 2 years ago
parent
commit
cff1f2bb87
  1. 26
      lib/pleroma/web/activity_pub/mrf/user_disallowlist.ex
  2. 1
      update.sh

26
lib/pleroma/web/activity_pub/mrf/user_disallowlist.ex

@ -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

1
update.sh

@ -1,3 +1,4 @@
set -x
mix local.hex --force
mix deps.get
mix local.rebar --force

Loading…
Cancel
Save