forked from AkkomaGang/akkoma
more formatting
This commit is contained in:
parent
5b9e1f228a
commit
990cde7439
1 changed files with 6 additions and 10 deletions
|
@ -10,20 +10,16 @@ def filter(object) do
|
||||||
#Determine visibility
|
#Determine visibility
|
||||||
visibility =
|
visibility =
|
||||||
cond do
|
cond do
|
||||||
#Public
|
public in object["to"] -> "public"
|
||||||
public in object["to"] -> "p"
|
public in object["cc"] -> "unlisted"
|
||||||
#Unlisted
|
user.follower_address in object["to"] -> "followers"
|
||||||
public in object["cc"] -> "u"
|
true -> "direct"
|
||||||
#Followers-only
|
|
||||||
user.follower_address in object["to"] -> "f"
|
|
||||||
#Direct
|
|
||||||
true -> "d"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
{flag, object_out} =
|
{flag, object_out} =
|
||||||
case visibility do
|
case visibility do
|
||||||
"p" -> {:ok, object}
|
"public" -> {:ok, object}
|
||||||
"u" -> {:ok, object}
|
"unlisted" -> {:ok, object}
|
||||||
_ -> {:reject, nil}
|
_ -> {:reject, nil}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue