mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-17 08:36:38 +00:00
fix: no completar el contenido si el objeto tiene actividades canceladas
This commit is contained in:
parent
fc7c2e5b74
commit
dca266714d
2 changed files with 2 additions and 2 deletions
|
@ -11,6 +11,8 @@ class ActivityPub
|
||||||
class FetchJob < ApplicationJob
|
class FetchJob < ApplicationJob
|
||||||
def perform(site:, object:)
|
def perform(site:, object:)
|
||||||
ActivityPub::Object.transaction do
|
ActivityPub::Object.transaction do
|
||||||
|
return if object.activity_pubs.where(aasm_state: 'removed').count.positive?
|
||||||
|
|
||||||
response = site.social_inbox.dereferencer.get(uri: object.uri)
|
response = site.social_inbox.dereferencer.get(uri: object.uri)
|
||||||
|
|
||||||
# @todo Fallar cuando la respuesta no funcione?
|
# @todo Fallar cuando la respuesta no funcione?
|
||||||
|
|
|
@ -38,8 +38,6 @@ class ActivityPub < ApplicationRecord
|
||||||
event :remove do
|
event :remove do
|
||||||
transitions to: :removed
|
transitions to: :removed
|
||||||
|
|
||||||
# @todo Es posible que haya un ActivityPub::FetchJob pendiente
|
|
||||||
# cuando estamos haciendo esto, que rellene el objeto después.
|
|
||||||
before do
|
before do
|
||||||
object.update(content: {}) unless object.content.empty?
|
object.update(content: {}) unless object.content.empty?
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue