activitypub: fix possible false positives with broken thread filtering

This commit is contained in:
William Pitcock 2018-10-28 05:45:33 +00:00
parent 310a4bc25c
commit 72ea54de6e
1 changed files with 3 additions and 2 deletions

View File

@ -793,9 +793,10 @@ def entire_thread_visible_for_user?(nil, user), do: false
# child
def entire_thread_visible_for_user?(
%Activity{data: %{"object" => %{"inReplyTo" => _parent_id}}} = tail,
%Activity{data: %{"object" => %{"inReplyTo" => parent_id}}} = tail,
user
) do
)
when is_binary(parent_id) do
parent = Activity.get_in_reply_to_activity(tail)
visible_for_user?(tail, user) && entire_thread_visible_for_user?(parent, user)
end