projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
KeywordPolicy: Still match when fields are absent
[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 ce8bc458020be861b3b5ac299221fa635cdc0898..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