diff options
author | tusooa <tusooa@kazv.moe> | 2023-11-07 21:16:24 -0500 |
---|---|---|
committer | tusooa <tusooa@kazv.moe> | 2023-12-27 12:28:10 -0500 |
commit | e34a975dd946cc609638d85c20a57e2bfed6ebc7 (patch) | |
tree | 981f1d1e4f5595fc681386c7a7fcee73d89ca0b0 /lib | |
parent | 5f5533b88a66bdd3547eb5e29f29191093457052 (diff) | |
download | pleroma-e34a975dd946cc609638d85c20a57e2bfed6ebc7.tar.gz pleroma-e34a975dd946cc609638d85c20a57e2bfed6ebc7.zip |
Do not boost if group is blocking poster
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/activity_pub/utils.ex | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/pleroma/web/activity_pub/utils.ex b/lib/pleroma/web/activity_pub/utils.ex index e4edbd5ee..e2fc2640d 100644 --- a/lib/pleroma/web/activity_pub/utils.ex +++ b/lib/pleroma/web/activity_pub/utils.ex @@ -937,13 +937,19 @@ defmodule Pleroma.Web.ActivityPub.Utils do end def maybe_handle_group_posts(activity) do + poster = User.get_cached_by_ap_id(activity.actor) + mentions = activity.data["to"] |> Enum.filter(&(&1 != activity.actor)) mentioned_local_groups = User.get_all_by_ap_id(mentions) - |> Enum.filter(&(&1.actor_type == "Group" and &1.local)) + |> Enum.filter(fn user -> + user.actor_type == "Group" and + user.local and + not User.blocks?(user, poster) + end) mentioned_local_groups |> Enum.each(fn group -> |