activitypub: fix possible false positives with broken thread filtering
authorWilliam Pitcock <nenolod@dereferenced.org>
Sun, 28 Oct 2018 05:45:33 +0000 (05:45 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Sun, 28 Oct 2018 05:45:33 +0000 (05:45 +0000)
lib/pleroma/web/activity_pub/activity_pub.ex

index 173ca688dad555ea2ec691106203008d04620e7f..4b8b6eb5213721dee264d9bb653b630d43661721 100644 (file)
@@ -793,9 +793,10 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
 
   # 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