%User{ap_id: _} = user,
%Object{data: %{"id" => _}} = object,
activity_id \\ nil,
- local \\ true
+ local \\ true,
+ public \\ true
) do
with true <- is_public?(object),
- announce_data <- make_announce_data(user, object, activity_id),
+ announce_data <- make_announce_data(user, object, activity_id, public),
{:ok, activity} <- insert(announce_data, local),
{:ok, object} <- add_announce_to_object(activity, object),
:ok <- maybe_federate(activity) do
"""
# for relayed messages, we only want to send to subscribers
def make_announce_data(
- %User{ap_id: ap_id, nickname: nil} = user,
+ %User{ap_id: ap_id} = user,
%Object{data: %{"id" => id}} = object,
- activity_id
+ activity_id,
+ false
) do
data = %{
"type" => "Announce",
def make_announce_data(
%User{ap_id: ap_id} = user,
%Object{data: %{"id" => id}} = object,
- activity_id
+ activity_id,
+ true
) do
data = %{
"type" => "Announce",