Add User.decrease_note_count and call it from ActivityPub.delete

This commit is contained in:
Dashie 2018-04-24 11:34:18 +02:00
commit 9972678a68
No known key found for this signature in database
GPG key ID: C2D57B325840B755
3 changed files with 31 additions and 1 deletions

View file

@ -172,7 +172,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
with Repo.delete(object),
Repo.delete_all(Activity.all_non_create_by_object_ap_id_q(id)),
{:ok, activity} <- insert(data, local),
:ok <- maybe_federate(activity) do
:ok <- maybe_federate(activity),
{:ok, actor} <- User.decrease_note_count(user) do
{:ok, activity}
end
end