aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2018-05-26 16:25:32 +0200
committerlain <lain@soykaf.club>2018-05-26 16:25:32 +0200
commit841ee8e3e4d31d4236a022d46fe18f7751605c74 (patch)
tree081b1ec261dd7d2cd56a77344ccf0b6217ec3996 /lib
parent4b3ec5351466f8615b32e62cc4e6215f8a80b105 (diff)
downloadpleroma-841ee8e3e4d31d4236a022d46fe18f7751605c74.tar.gz
Simplify DM query.
Should also use indexes better.
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/activity_pub/activity_pub.ex8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex
index d54dc224d..4e0be5ba2 100644
--- a/lib/pleroma/web/activity_pub/activity_pub.ex
+++ b/lib/pleroma/web/activity_pub/activity_pub.ex
@@ -313,9 +313,11 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
on: sender.ap_id == activity.actor,
# Are non-direct statuses with no to/cc possible?
where:
- 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)
+ fragment(
+ "not (? && ?)",
+ [^public, sender.follower_address],
+ activity.recipients
+ )
)
end