From 22f730b805dbcfc4daa16bde2147872d07250ceb Mon Sep 17 00:00:00 2001 From: f Date: Fri, 1 Mar 2024 17:14:24 -0300 Subject: [PATCH] fix: guardar el tipo correcto de objeto si lo soportamos --- .../api/v1/webhooks/social_inbox_controller.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/v1/webhooks/social_inbox_controller.rb b/app/controllers/api/v1/webhooks/social_inbox_controller.rb index 3de32104..dec2ee97 100644 --- a/app/controllers/api/v1/webhooks/social_inbox_controller.rb +++ b/app/controllers/api/v1/webhooks/social_inbox_controller.rb @@ -116,7 +116,15 @@ module Api # XXX: Si el objeto es una actividad, esto siempre va a ser # Generic o.type ||= 'ActivityPub::Object::Generic' - o.content = original_object if object_embedded? + + if object_embedded? + o.content = original_object + begin + type = original_object[:type].presence + o.type = "ActivityPub::Object::#{type}".constantize if type + rescue NameError + end + end o.save!