5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-10-11 22:16:56 +00:00

Merge branch 'issue-15109-1' of https://0xacab.org/sutty/sutty into production.panel.sutty.nl

This commit is contained in:
Sutty 2024-03-13 20:03:29 +00:00
commit 5065188bac

View file

@ -13,22 +13,24 @@ class ActivityPub
# lo haría la Social Inbox por nosotres. # lo haría la Social Inbox por nosotres.
# @see {https://docs.joinmastodon.org/spec/security/#ld} # @see {https://docs.joinmastodon.org/spec/security/#ld}
def update_activity_pub_state! def update_activity_pub_state!
ActivityPub.transaction do ActiveRecord::Base.connection_pool.with_connection do
object = ActivityPub::Object.find_by(uri: ActivityPub.uri_from_object(content['object'])) ActivityPub.transaction do
object = ActivityPub::Object.find_by(uri: ActivityPub.uri_from_object(content['object']))
if object.present? if object.present?
object.activity_pubs.find_each do |activity_pub| object.activity_pubs.find_each do |activity_pub|
activity_pub.remove! if activity_pub.may_remove? activity_pub.remove! if activity_pub.may_remove?
end
# 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!
end
end end
# Encontrar todas las acciones de moderación de le actore activity_pub.remove! if activity_pub.may_remove?
# eliminade y moverlas a eliminar.
if object.actor_type? && object.actor.present?
ActorModeration.where(actor_id: object.actor.id).remove_all!
end
end end
activity_pub.remove! if activity_pub.may_remove?
end end
end end
end end