projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
List messages must be visible for mentioned users
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
mrf.ex
diff --git
a/lib/pleroma/web/activity_pub/mrf.ex
b/lib/pleroma/web/activity_pub/mrf.ex
index 3bf7955f32b918eb47f7585d303473e78ed3a575..10ceef715faed9abfef0d9009d14d0138800927e 100644
(file)
--- a/
lib/pleroma/web/activity_pub/mrf.ex
+++ b/
lib/pleroma/web/activity_pub/mrf.ex
@@
-5,8
+5,8
@@
defmodule Pleroma.Web.ActivityPub.MRF do
@callback filter(Map.t()) :: {:ok | :reject, Map.t()}
defmodule Pleroma.Web.ActivityPub.MRF do
@callback filter(Map.t()) :: {:ok | :reject, Map.t()}
- def filter(object) do
- get_policies()
+ def filter(
policies, %{} =
object) do
+ policies
|> Enum.reduce({:ok, object}, fn
policy, {:ok, object} ->
policy.filter(object)
|> Enum.reduce({:ok, object}, fn
policy, {:ok, object} ->
policy.filter(object)
@@
-16,6
+16,8
@@
defmodule Pleroma.Web.ActivityPub.MRF do
end)
end
end)
end
+ def filter(%{} = object), do: get_policies() |> filter(object)
+
def get_policies do
Pleroma.Config.get([:instance, :rewrite_policy], []) |> get_policies()
end
def get_policies do
Pleroma.Config.get([:instance, :rewrite_policy], []) |> get_policies()
end