{recipients, to, cc}
end
+ defp get_recipients(%{"type" => "Create"} = data) do
+ to = data["to"] || []
+ cc = data["cc"] || []
+ actor = data["actor"] || []
+ recipients = (to ++ cc ++ [actor]) |> Enum.uniq()
+ {recipients, to, cc}
+ end
+
defp get_recipients(data) do
to = data["to"] || []
cc = data["cc"] || []
public = is_public?(activity)
- 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}} ->
- (is_map(data["endpoints"]) && Map.get(data["endpoints"], "sharedInbox")) || data["inbox"]
- end)
- |> Enum.uniq()
- |> Enum.filter(fn inbox -> should_federate?(inbox, public) end)
-
{:ok, data} = Transmogrifier.prepare_outgoing(activity.data)
json = Jason.encode!(data)
- Enum.each(remote_inboxes, fn inbox ->
- Federator.enqueue(:publish_single_ap, %{
+ (Pleroma.Web.Salmon.remote_users(activity) ++ followers)
+ |> Enum.filter(fn user -> User.ap_enabled?(user) end)
+ |> Enum.map(fn %{info: %{source_data: data}} ->
+ (is_map(data["endpoints"]) && Map.get(data["endpoints"], "sharedInbox")) || data["inbox"]
+ end)
+ |> Enum.uniq()
+ |> Enum.filter(fn inbox -> should_federate?(inbox, public) end)
+ |> Enum.each(fn inbox ->
+ Federator.publish_single_ap(%{
inbox: inbox,
json: json,
actor: actor,