X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Factivity_pub%2Factivity_pub.ex;h=a4f1c7041969510c30a2a2cecefb9ac6f98132ff;hb=ec6bf8c3f7a2d429b1eddcada1e39ec9dba4edec;hp=8233bcbf8f36edb05bf6be51ac5079a6241e4df4;hpb=4c3971aebd9cb950e300aee17598a7be6e94691c;p=akkoma diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index 8233bcbf8..a4f1c7041 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -933,29 +933,6 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do ) end - # Essentially, either look for activities addressed to `recipients`, _OR_ ones - # that reference a hashtag that the user follows - # Firstly, two fallbacks in case there's no hashtag constraint, or the user doesn't - # follow any - defp restrict_recipients_or_hashtags(query, recipients, user, nil) do - restrict_recipients(query, recipients, user) - end - - defp restrict_recipients_or_hashtags(query, recipients, user, []) do - restrict_recipients(query, recipients, user) - end - - defp restrict_recipients_or_hashtags(query, recipients, _user, hashtag_ids) do - from( - [activity, object] in query, - join: 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) - ) - end - defp restrict_local(query, %{local_only: true}) do from(activity in query, where: activity.local == true) end @@ -1403,7 +1380,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do |> maybe_preload_report_notes(opts) |> maybe_set_thread_muted_field(opts) |> maybe_order(opts) - |> restrict_recipients_or_hashtags(recipients, opts[:user], opts[:followed_hashtags]) + |> restrict_recipients(recipients, opts[:user]) |> restrict_replies(opts) |> restrict_since(opts) |> restrict_local(opts)