1
0
Fork 1
mirror of https://akkoma.dev/AkkomaGang/akkoma.git synced 2024-12-25 04:53:06 +00:00

Visibility: check Tombstone objects in visible_for_user?/2

This commit is contained in:
Alex Gleason 2021-07-27 08:54:01 -05:00
parent b221d77a6d
commit 9cc8642b80
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -57,6 +57,7 @@ def is_list?(%{data: %{"listMessage" => _}}), do: true
def is_list?(_), do: false
@spec visible_for_user?(Object.t() | Activity.t() | nil, User.t() | nil) :: boolean()
def visible_for_user?(%Object{data: %{"type" => "Tombstone"}}, _), do: false
def visible_for_user?(%Activity{actor: ap_id}, %User{ap_id: ap_id}), do: true
def visible_for_user?(%Object{data: %{"actor" => ap_id}}, %User{ap_id: ap_id}), do: true
def visible_for_user?(nil, _), do: false