more formatting
This commit is contained in:
parent
5b9e1f228a
commit
990cde7439
|
@ -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 New Issue