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

feat: almacenar el perfil de le actore en la base de datos

This commit is contained in:
f 2024-03-06 15:54:47 -03:00
parent 5c22015fe2
commit 019101ba1e
No known key found for this signature in database
2 changed files with 9 additions and 1 deletions

View file

@ -19,7 +19,7 @@ class ActivityPub
return unless response.ok? return unless response.ok?
return if response.miss? && actor.content.present? return if response.miss? && actor.content.present?
actor.update(content: FastJsonparser.parse(response.body)) actor.object.update(content: FastJsonparser.parse(response.body))
end end
end end
end end

View file

@ -25,5 +25,13 @@ class ActivityPub
@mention ||= "@#{content['preferredUsername']}@#{instance.hostname}" @mention ||= "@#{content['preferredUsername']}@#{instance.hostname}"
end end
def object
@object ||= ActivityPub::Object::Person.find_or_initialize_by(uri: uri)
end
def content
object.content
end
end end
end end