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
1 changed files with 6 additions and 10 deletions

View File

@ -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