From: lain Date: Sun, 18 Feb 2018 15:59:41 +0000 (+0100) Subject: Fix delivery to CC. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=deaad6d97a6850a01ce450c7442629ebb3a52f26;p=akkoma Fix delivery to CC. --- diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index 1a795bad1..4bfcd3234 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -280,10 +280,10 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do 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 diff --git a/lib/pleroma/web/salmon/salmon.ex b/lib/pleroma/web/salmon/salmon.ex index 806f3c3c0..4e95a5b25 100644 --- a/lib/pleroma/web/salmon/salmon.ex +++ b/lib/pleroma/web/salmon/salmon.ex @@ -138,7 +138,8 @@ defmodule Pleroma.Web.Salmon do {: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)