5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 11:46:22 +00:00

fix: permitir guardar le actore si la instancia ya existía

This commit is contained in:
f 2024-02-24 12:47:11 -03:00
parent 9e54d6311c
commit a76c652f98
No known key found for this signature in database

View file

@ -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!