5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-21 22:36:22 +00:00

fix: eliminar actores cuando no se pudo completar el objeto #15576

This commit is contained in:
f 2024-03-14 11:20:04 -03:00
parent b6ed91df11
commit 9d71c5fa0c
No known key found for this signature in database
2 changed files with 17 additions and 2 deletions

View file

@ -24,8 +24,8 @@ class ActivityPub
# Encontrar todas las acciones de moderación de le actore
# eliminade y moverlas a eliminar.
if object.actor_type? && object.actor.present?
ActorModeration.where(actor_id: object.actor.id).remove_all!
if (actor = ActivityPub::Actor.find_by(uri: o.uri)).present?
ActorModeration.where(actor_id: actor.id).remove_all!
end
end

View file

@ -0,0 +1,15 @@
# frozen_string_literal: true
# Elimina actores que no pudieron ser eliminades porque su perfil ya no
# existe.
class RemoveActorModerationsForGenericObjects < ActiveRecord::Migration[6.1]
def up
object_ids = ActivityPub.removed.where(object_type: 'ActivityPub::Object::Generic').distinct.pluck(:object_id)
uris = ActivityPub::Object.where(id: object_ids).pluck(:uri)
actor_ids = ActivityPub::Actor.where(uri: uris).ids
ActorModeration.where(actor_id: actor_ids).remove_all!
end
def down; end
end