Remerge of hashtag following #341

Merged
floatingghost merged 10 commits from follow-hashtags into develop 2022-12-05 12:58:48 +00:00
Showing only changes of commit 9427ebf70e - Show all commits

View file

@ -946,11 +946,13 @@ 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
)
|> where(
[activity, object, hto: hto],
(hto.hashtag_id in ^hashtag_ids and ^Constants.as_public() in activity.recipients) or (hto.hashtag_id in ^hashtag_ids and ^Constants.as_public() in activity.recipients) or
fragment("? && ?", ^recipients, activity.recipients) fragment("? && ?", ^recipients, activity.recipients)
) )