diff options
author | lain <lain@soykaf.club> | 2018-02-18 16:59:41 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2018-02-18 16:59:41 +0100 |
commit | deaad6d97a6850a01ce450c7442629ebb3a52f26 (patch) | |
tree | e1dfa32e2a111a13dd5741ed65848a053f8e9a5f | |
parent | 8567feed474c2bebcc02c7ab177e18d35c26aec6 (diff) | |
download | pleroma-deaad6d97a6850a01ce450c7442629ebb3a52f26.tar.gz |
Fix delivery to CC.
-rw-r--r-- | lib/pleroma/web/activity_pub/activity_pub.ex | 4 | ||||
-rw-r--r-- | 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 @@ 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) |