From 342d0b01d17b3035378d6906672e1e8c4008ff4c Mon Sep 17 00:00:00 2001 From: lain Date: Sun, 18 Feb 2018 23:01:37 +0100 Subject: [PATCH] Only push to followers if they are addressed. --- lib/pleroma/web/activity_pub/activity_pub.ex | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index fb33f2e3e..168653035 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -283,7 +283,12 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do end def publish(actor, activity) do - {:ok, followers} = User.get_followers(actor) + followers = if user.follower_address in activity.recipients do + {:ok, followers} = User.get_followers(actor) + followers + else + [] + end remote_inboxes = (Pleroma.Web.Salmon.remote_users(activity) ++ followers) |> Enum.filter(fn (user) -> User.ap_enabled?(user) end)