5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-06-02 06:54:17 +00:00

fix: undo auto-cancela la actividad

This commit is contained in:
f 2024-02-21 17:05:17 -03:00
parent e53f31f359
commit fc7c2e5b74
No known key found for this signature in database
2 changed files with 15 additions and 1 deletions

View file

@ -38,8 +38,10 @@ class ActivityPub < ApplicationRecord
event :remove do
transitions to: :removed
# @todo Es posible que haya un ActivityPub::FetchJob pendiente
# cuando estamos haciendo esto, que rellene el objeto después.
before do
object.update(content: {})
object.update(content: {}) unless object.content.empty?
end
end

View file

@ -7,6 +7,18 @@
class ActivityPub
class Activity
class Undo < ActivityPub::Activity
# Una actividad de deshacer tiene anidada como objeto la actividad
# a deshacer. Para respetar la voluntad de le actore remote,
# tendríamos que eliminar cualquier actividad pendiente sobre el
# objeto.
#
# Sin embargo, estas acciones nunca deberían llegar a nuestra
# Inbox.
#
# @see {https://github.com/hyphacoop/social.distributed.press/issues/43}
def update_activity_pub_state!
activity_pub.remove!
end
end
end
end