Handle cases where a to/cc field is absent on a status
This commit is contained in:
parent
987a52cf6f
commit
4dfb40a546
1 changed files with 4 additions and 2 deletions
|
@ -239,9 +239,11 @@ defp restrict_visibility(query, %{visibility: "direct"}) do
|
||||||
activity in query,
|
activity in query,
|
||||||
join: sender in User,
|
join: sender in User,
|
||||||
on: sender.ap_id == activity.actor,
|
on: sender.ap_id == activity.actor,
|
||||||
|
# Are non-direct statuses with no to/cc possible?
|
||||||
where:
|
where:
|
||||||
fragment("not data->'to' \\? ?", ^public) and fragment("not data->'cc' \\? ?", ^public) and
|
fragment("not coalesce(data->'to' \\? ?, false)", ^public) and
|
||||||
fragment("not data->'to' \\? ?", sender.follower_address)
|
fragment("not coalesce(data->'cc' \\? ?, false)", ^public) and
|
||||||
|
fragment("not coalesce(data->'to' \\? ?, false)", sender.follower_address)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue