From deaad6d97a6850a01ce450c7442629ebb3a52f26 Mon Sep 17 00:00:00 2001 From: lain Date: Sun, 18 Feb 2018 16:59:41 +0100 Subject: [PATCH] Fix delivery to CC. --- lib/pleroma/web/activity_pub/activity_pub.ex | 4 ++-- lib/pleroma/web/salmon/salmon.ex | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) 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 @@ def make_user_from_nickname(nickname) 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 @@ def encode(private_key, doc) 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)