Simplify DM query.
Should also use indexes better.
This commit is contained in:
parent
4b3ec53514
commit
841ee8e3e4
2 changed files with 37 additions and 14 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue