- def announce(actor, object) do
- to = [actor.follower_address, object.data["actor"]]
+ @spec announce(User.t(), Object.t(), keyword()) :: {:ok, map(), keyword()}
+ def announce(actor, object, options \\ []) do
+ public? = Keyword.get(options, :public, false)
+
+ to =
+ cond do
+ actor.ap_id == Relay.relay_ap_id() ->
+ [actor.follower_address]
+
+ public? ->
+ [actor.follower_address, object.data["actor"], Pleroma.Constants.as_public()]
+
+ true ->
+ [actor.follower_address, object.data["actor"]]
+ end