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,13 +946,15 @@ defp restrict_recipients_or_hashtags(query, recipients, user, []) do
end
defp restrict_recipients_or_hashtags(query, recipients, _user, hashtag_ids) do
from(
[activity, object] in query,
join: hto in "hashtags_objects",
from([activity, object] in query)
|> join(:left, [activity, object], hto in "hashtags_objects",
on: hto.object_id == object.id,
where:
(hto.hashtag_id in ^hashtag_ids and ^Constants.as_public() in activity.recipients) or
fragment("? && ?", ^recipients, activity.recipients)
as: :hto
)
|> where(
[activity, object, hto: hto],
(hto.hashtag_id in ^hashtag_ids and ^Constants.as_public() in activity.recipients) or
fragment("? && ?", ^recipients, activity.recipients)
)
end