mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 20:36:21 +00:00
feat: eliminar un objeto elimina todas las actividades pendientes
This commit is contained in:
parent
a51cb4dbdd
commit
a4062c5f54
1 changed files with 12 additions and 3 deletions
|
@ -3,10 +3,19 @@
|
||||||
class ActivityPub
|
class ActivityPub
|
||||||
class Activity
|
class Activity
|
||||||
class Delete < ActivityPub::Activity
|
class Delete < ActivityPub::Activity
|
||||||
# Si estamos eliminando el objeto, tenemos que vaciar su contenido y
|
# Los Delete se refieren a objetos. Al eliminar un objeto,
|
||||||
# cambiar el estado a borrado.
|
# cancelamos todas las actividades que tienen relacionadas.
|
||||||
|
#
|
||||||
|
# XXX: La actividad tiene una firma, pero la implementación no
|
||||||
|
# está recomendada
|
||||||
|
#
|
||||||
|
# @see {https://docs.joinmastodon.org/spec/security/#ld}
|
||||||
def update_activity_pub_state!
|
def update_activity_pub_state!
|
||||||
activity_pub.remove!
|
ActivityPub.transaction do
|
||||||
|
ActivityPub::Object.find_by(uri: ActivityPub.uri_from_object(content['object']))&.activity_pubs&.find_each(&:remove!)
|
||||||
|
|
||||||
|
activity_pub.remove!
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue