X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Factivity_pub%2Fbuilder.ex;h=6d39ad3a858bec9394acb0c9baac3d44f29a860e;hb=a079ec3a3cdfd42d2cbd51c7698c2c87828e5778;hp=71ccbdef59a2ddc83acd0693243b06edd5ba9513;hpb=1b826eea543d5210d9004c8b418d41285238f5b4;p=akkoma diff --git a/lib/pleroma/web/activity_pub/builder.ex b/lib/pleroma/web/activity_pub/builder.ex index 71ccbdef5..6d39ad3a8 100644 --- a/lib/pleroma/web/activity_pub/builder.ex +++ b/lib/pleroma/web/activity_pub/builder.ex @@ -80,7 +80,7 @@ defmodule Pleroma.Web.ActivityPub.Builder do end defp remote_custom_emoji_react( - %{data: %{"reactions" => existing_reactions}} = object, + %{data: %{"reactions" => existing_reactions}}, data, emoji ) do @@ -103,7 +103,7 @@ defmodule Pleroma.Web.ActivityPub.Builder do end end - defp remote_custom_emoji_react(_object, data, emoji) do + defp remote_custom_emoji_react(_object, _data, _emoji) do {:error, "Could not react"} end @@ -278,10 +278,16 @@ defmodule Pleroma.Web.ActivityPub.Builder do end end - # Retricted to user updates for now, always public @spec update(User.t(), Object.t()) :: {:ok, map(), keyword()} def update(actor, object) do - to = [Pleroma.Constants.as_public(), actor.follower_address] + {to, cc} = + if object["type"] in Pleroma.Constants.actor_types() do + # User updates, always public + {[Pleroma.Constants.as_public(), actor.follower_address], []} + else + # Status updates, follow the recipients in the object + {object["to"] || [], object["cc"] || []} + end {:ok, %{ @@ -289,7 +295,8 @@ defmodule Pleroma.Web.ActivityPub.Builder do "type" => "Update", "actor" => actor.ap_id, "object" => object, - "to" => to + "to" => to, + "cc" => cc }, []} end