def publish(actor, activity) do
{:ok, followers} = User.get_followers(actor)
- remote_inboxes = Pleroma.Web.Salmon.remote_users(activity) ++ followers
+ remote_inboxes = (Pleroma.Web.Salmon.remote_users(activity) ++ followers)
|> Enum.filter(fn (user) -> User.ap_enabled?(user) end)
|> Enum.map(fn (%{info: %{"source_data" => data}}) ->
- (data["endpoints"] && data["endpoints"]["sharedInbox"]) ||data["inbox"]
+ (data["endpoints"] && data["endpoints"]["sharedInbox"]) || data["inbox"]
end)
|> Enum.uniq
{:ok, salmon}
end
- def remote_users(%{data: %{"to" => to}}) do
+ def remote_users(%{data: %{"to" => to} = data}) do
+ to = to ++ (data["cc"] || [])
to
|> Enum.map(fn(id) -> User.get_cached_by_ap_id(id) end)
|> Enum.filter(fn(user) -> user && !user.local end)