SideEffects: On deletion, reduce the User note count.
This commit is contained in:
parent
3d0dc58e2e
commit
ab60ee1776
2 changed files with 8 additions and 2 deletions
|
|
@ -34,6 +34,7 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do
|
|||
# - Delete and unpins the create activity
|
||||
# - Replace object with Tombstone
|
||||
# - Set up notification
|
||||
# - Reduce the user note count
|
||||
def handle(%{data: %{"type" => "Delete", "object" => deleted_object}} = object, meta) do
|
||||
deleted_object =
|
||||
Object.normalize(deleted_object, false) || User.get_cached_by_ap_id(deleted_object)
|
||||
|
|
@ -45,6 +46,7 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do
|
|||
%User{} = user <- User.get_cached_by_ap_id(deleted_object.data["actor"]) do
|
||||
User.remove_pinnned_activity(user, activity)
|
||||
|
||||
{:ok, user} = ActivityPub.decrease_note_count_if_public(user, deleted_object)
|
||||
ActivityPub.stream_out(object)
|
||||
ActivityPub.stream_out_participations(deleted_object, user)
|
||||
:ok
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue