diff --git a/app/controllers/api/v1/webhooks/social_inbox_controller.rb b/app/controllers/api/v1/webhooks/social_inbox_controller.rb index a5951716..a1ff9677 100644 --- a/app/controllers/api/v1/webhooks/social_inbox_controller.rb +++ b/app/controllers/api/v1/webhooks/social_inbox_controller.rb @@ -147,11 +147,11 @@ module Api # @return [Actor] def actor @actor ||= ActivityPub::Actor.find_or_initialize_by(uri: original_activity[:actor]).tap do |a| - next if a.instance + unless a.instance + a.instance = ActivityPub::Instance.find_or_create_by(hostname: URI.parse(a.uri).hostname) - a.instance = ActivityPub::Instance.find_or_create_by(hostname: URI.parse(a.uri).hostname) - - ActivityPub::InstanceFetchJob.perform_later(site: site, instance: a.instance) + ActivityPub::InstanceFetchJob.perform_later(site: site, instance: a.instance) + end a.save!