projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
implemented tweaks
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
mrf
/
reject_non_public.ex
diff --git
a/lib/pleroma/web/activity_pub/mrf/reject_non_public.ex
b/lib/pleroma/web/activity_pub/mrf/reject_non_public.ex
index 129d0461775b27aa5a1ca03da690f4e83cd54c59..4197be847c635167e95bd30af053b00f3f0aa0cf 100644
(file)
--- a/
lib/pleroma/web/activity_pub/mrf/reject_non_public.ex
+++ b/
lib/pleroma/web/activity_pub/mrf/reject_non_public.ex
@@
-1,11
+1,11
@@
+# 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.RejectNonPublic do
alias Pleroma.User
@behaviour Pleroma.Web.ActivityPub.MRF
defmodule Pleroma.Web.ActivityPub.MRF.RejectNonPublic do
alias Pleroma.User
@behaviour Pleroma.Web.ActivityPub.MRF
- @mrf_rejectnonpublic Application.get_env(:pleroma, :mrf_rejectnonpublic)
- @allow_followersonly Keyword.get(@mrf_rejectnonpublic, :allow_followersonly)
- @allow_direct Keyword.get(@mrf_rejectnonpublic, :allow_direct)
-
@impl true
def filter(%{"type" => "Create"} = object) do
user = User.get_cached_by_ap_id(object["actor"])
@impl true
def filter(%{"type" => "Create"} = object) do
user = User.get_cached_by_ap_id(object["actor"])
@@
-20,6
+20,8
@@
defmodule Pleroma.Web.ActivityPub.MRF.RejectNonPublic do
true -> "direct"
end
true -> "direct"
end
+ policy = Pleroma.Config.get(:mrf_rejectnonpublic)
+
case visibility do
"public" ->
{:ok, object}
case visibility do
"public" ->
{:ok, object}
@@
-28,14
+30,14
@@
defmodule Pleroma.Web.ActivityPub.MRF.RejectNonPublic do
{:ok, object}
"followers" ->
{:ok, object}
"followers" ->
- with true <-
@allow_followersonly
do
+ with true <-
Keyword.get(policy, :allow_followersonly)
do
{:ok, object}
else
_e -> {:reject, nil}
end
"direct" ->
{:ok, object}
else
_e -> {:reject, nil}
end
"direct" ->
- with true <-
@allow_direct
do
+ with true <-
Keyword.get(policy, :allow_direct)
do
{:ok, object}
else
_e -> {:reject, nil}
{:ok, object}
else
_e -> {:reject, nil}