summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2018-02-18 23:01:37 +0100
committerlain <lain@soykaf.club>2018-02-18 23:01:37 +0100
commit342d0b01d17b3035378d6906672e1e8c4008ff4c (patch)
tree2938654d33cae4c6d5323a0efd68b195e3aa7999
parent78516a8daa7094506e0247e8bdaddfde77a4ba67 (diff)
downloadpleroma-342d0b01d17b3035378d6906672e1e8c4008ff4c.tar.gz
pleroma-342d0b01d17b3035378d6906672e1e8c4008ff4c.zip
Only push to followers if they are addressed.
-rw-r--r--lib/pleroma/web/activity_pub/activity_pub.ex7
1 files changed, 6 insertions, 1 deletions
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)