mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-23 02:16:22 +00:00
parent
dad5f5f00c
commit
071f20762c
1 changed files with 4 additions and 4 deletions
|
@ -64,9 +64,9 @@ class ActivityPub
|
|||
# @return [ActivityPub::Object]
|
||||
def object
|
||||
@object ||= ::ActivityPub::Object.lock.find_or_initialize_by(uri: object_uri).tap do |o|
|
||||
o.lock! if o.persisted?
|
||||
o.content = original_object if object_embedded?
|
||||
|
||||
o.lock! if o.persisted?
|
||||
o.save!
|
||||
|
||||
# XXX: el objeto necesita ser guardado antes de poder
|
||||
|
@ -94,9 +94,9 @@ class ActivityPub
|
|||
.type_from(original_activity)
|
||||
.lock
|
||||
.find_or_initialize_by(uri: original_activity[:id], activity_pub: activity_pub, actor: actor).tap do |a|
|
||||
a.lock! if o.persisted?
|
||||
a.content = original_activity.dup
|
||||
a.content[:object] = object.uri
|
||||
a.lock! if o.persisted?
|
||||
a.save!
|
||||
end
|
||||
end
|
||||
|
@ -107,6 +107,8 @@ class ActivityPub
|
|||
# @return [Actor]
|
||||
def actor
|
||||
@actor ||= ::ActivityPub::Actor.lock.find_or_initialize_by(uri: original_activity[:actor]).tap do |a|
|
||||
a.lock! if o.persisted?
|
||||
|
||||
unless a.instance
|
||||
a.instance = ::ActivityPub::Instance.lock.find_or_create_by(hostname: URI.parse(a.uri).hostname)
|
||||
|
||||
|
@ -114,8 +116,6 @@ class ActivityPub
|
|||
end
|
||||
|
||||
site.instance_moderations.lock.find_or_create_by(instance: a.instance)
|
||||
|
||||
a.lock! if o.persisted?
|
||||
a.save!
|
||||
|
||||
site.actor_moderations.lock.find_or_create_by(actor: a)
|
||||
|
|
Loading…
Reference in a new issue