more formatting

This commit is contained in:
squidboi 2018-06-07 22:03:24 -07:00
parent 5b9e1f228a
commit 990cde7439
No known key found for this signature in database
GPG key ID: 018925A9B65D2457

View file

@ -10,20 +10,16 @@ defmodule Pleroma.Web.ActivityPub.MRF.RejectNonPublic do
#Determine visibility
visibility =
cond do
#Public
public in object["to"] -> "p"
#Unlisted
public in object["cc"] -> "u"
#Followers-only
user.follower_address in object["to"] -> "f"
#Direct
true -> "d"
public in object["to"] -> "public"
public in object["cc"] -> "unlisted"
user.follower_address in object["to"] -> "followers"
true -> "direct"
end
{flag, object_out} =
case visibility do
"p" -> {:ok, object}
"u" -> {:ok, object}
"public" -> {:ok, object}
"unlisted" -> {:ok, object}
_ -> {:reject, nil}
end