This commit is contained in:
parent
c71e1e1e51
commit
9427ebf70e
1 changed files with 8 additions and 6 deletions
|
@ -946,13 +946,15 @@ defp restrict_recipients_or_hashtags(query, recipients, user, []) do
|
||||||
end
|
end
|
||||||
|
|
||||||
defp restrict_recipients_or_hashtags(query, recipients, _user, hashtag_ids) do
|
defp restrict_recipients_or_hashtags(query, recipients, _user, hashtag_ids) do
|
||||||
from(
|
from([activity, object] in query)
|
||||||
[activity, object] in query,
|
|> join(:left, [activity, object], hto in "hashtags_objects",
|
||||||
join: hto in "hashtags_objects",
|
|
||||||
on: hto.object_id == object.id,
|
on: hto.object_id == object.id,
|
||||||
where:
|
as: :hto
|
||||||
(hto.hashtag_id in ^hashtag_ids and ^Constants.as_public() in activity.recipients) or
|
)
|
||||||
fragment("? && ?", ^recipients, activity.recipients)
|
|> where(
|
||||||
|
[activity, object, hto: hto],
|
||||||
|
(hto.hashtag_id in ^hashtag_ids and ^Constants.as_public() in activity.recipients) or
|
||||||
|
fragment("? && ?", ^recipients, activity.recipients)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue