"to" => [user.follower_address, "https://www.w3.org/ns/activitystreams#Public"]
}
- with Repo.delete(object),
- Repo.delete_all(Activity.all_non_create_by_object_ap_id_q(id)),
+ with Object.delete(object),
{:ok, activity} <- insert(data, local),
:ok <- maybe_federate(activity),
{:ok, _actor} <- User.decrease_note_count(user) do
with %Activity{data: %{"object" => %{"id" => object_id}}} <- Repo.get(Activity, activity_id),
%Object{} = object <- Object.normalize(object_id),
true <- user.info["is_moderator"] || user.ap_id == object.data["actor"],
- {:ok, delete} <- ActivityPub.delete(object),
- {:ok, true} <- Cachex.del(:user_cache, "object:#{object_id}") do
+ {:ok, delete} <- ActivityPub.delete(object) do
{:ok, delete}
end
end