5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-26 09:06:21 +00:00

fix: guardar el tipo correcto de objeto si lo soportamos

This commit is contained in:
f 2024-03-01 17:14:24 -03:00
parent 9e1bda5570
commit 22f730b805
No known key found for this signature in database

View file

@ -116,7 +116,15 @@ module Api
# XXX: Si el objeto es una actividad, esto siempre va a ser # XXX: Si el objeto es una actividad, esto siempre va a ser
# Generic # Generic
o.type ||= 'ActivityPub::Object::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! o.save!