projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fetcher: Correctly return MRF reject reason
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
mrf
/
mention_policy.ex
diff --git
a/lib/pleroma/web/activity_pub/mrf/mention_policy.ex
b/lib/pleroma/web/activity_pub/mrf/mention_policy.ex
index 49717d45de2a1c014505a421fb38d4de147121bf..7910ca131830d3b782a2f3d5040c13f2196caefd 100644
(file)
--- a/
lib/pleroma/web/activity_pub/mrf/mention_policy.ex
+++ b/
lib/pleroma/web/activity_pub/mrf/mention_policy.ex
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-20
19
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-20
20
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.MRF.MentionPolicy do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.MRF.MentionPolicy do
@@
-12,8
+12,9
@@
defmodule Pleroma.Web.ActivityPub.MRF.MentionPolicy do
reject_actors = Pleroma.Config.get([:mrf_mention, :actors], [])
recipients = (message["to"] || []) ++ (message["cc"] || [])
reject_actors = Pleroma.Config.get([:mrf_mention, :actors], [])
recipients = (message["to"] || []) ++ (message["cc"] || [])
- if Enum.any?(recipients, fn recipient -> Enum.member?(reject_actors, recipient) end) do
- {:reject, nil}
+ if rejected_mention =
+ Enum.find(recipients, fn recipient -> Enum.member?(reject_actors, recipient) end) do
+ {:reject, "[MentionPolicy] Rejected for mention of #{rejected_mention}"}
else
{:ok, message}
end
else
{:ok, message}
end
@@
-23,5
+24,5
@@
defmodule Pleroma.Web.ActivityPub.MRF.MentionPolicy do
def filter(message), do: {:ok, message}
@impl true
def filter(message), do: {:ok, message}
@impl true
- def describe
()
, do: {:ok, %{}}
+ def describe, do: {:ok, %{}}
end
end