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
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue