aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcsaurus <csaurus@mailbox.org>2018-05-14 21:46:09 -0400
committercsaurus <csaurus@mailbox.org>2018-05-14 21:54:25 -0400
commit4dfb40a5467f6206b2793bdafbd82a7ae4ee04bf (patch)
tree996b74d8cc318cf0e383f0314069a3420ad6b7c9
parent987a52cf6f987e5178194615637753c9619e2e5d (diff)
downloadpleroma-4dfb40a5467f6206b2793bdafbd82a7ae4ee04bf.tar.gz
Handle cases where a to/cc field is absent on a status
-rw-r--r--lib/pleroma/web/activity_pub/activity_pub.ex6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex
index f7f6d047e..4ce2e6052 100644
--- a/lib/pleroma/web/activity_pub/activity_pub.ex
+++ b/lib/pleroma/web/activity_pub/activity_pub.ex
@@ -239,9 +239,11 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
activity in query,
join: sender in User,
on: sender.ap_id == activity.actor,
+ # Are non-direct statuses with no to/cc possible?
where:
- fragment("not data->'to' \\? ?", ^public) and fragment("not data->'cc' \\? ?", ^public) and
- fragment("not data->'to' \\? ?", sender.follower_address)
+ fragment("not coalesce(data->'to' \\? ?, false)", ^public) and
+ fragment("not coalesce(data->'cc' \\? ?, false)", ^public) and
+ fragment("not coalesce(data->'to' \\? ?, false)", sender.follower_address)
)
end