Only push to followers if they are addressed.
authorlain <lain@soykaf.club>
Sun, 18 Feb 2018 22:01:37 +0000 (23:01 +0100)
committerlain <lain@soykaf.club>
Sun, 18 Feb 2018 22:01:37 +0000 (23:01 +0100)
lib/pleroma/web/activity_pub/activity_pub.ex

index fb33f2e3ef2eddfc6e637fab797673acc3d0a443..168653035a3d056beb1aca744c904ba62b2b2ded 100644 (file)
@@ -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)