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

feat: referenciar objetos #15642

This commit is contained in:
f 2024-03-18 11:55:38 -03:00
parent 1623d618ee
commit 7b87aaa93d
No known key found for this signature in database
3 changed files with 19 additions and 1 deletions

View file

@ -29,5 +29,14 @@ class ActivityPub
def object_type?
true
end
# Poder explorar propiedades remotas
#
# @return [DistributedPress::V1::Social::ReferencedObject]
def referenced(site)
require 'distributed_press/v1/social/referenced_object'
@referenced ||= DistributedPress::V1::Social::ReferencedObject.new(object: content, dereferencer: site.social_inbox.dereferencer)
end
end
end

View file

@ -1,12 +1,21 @@
-#
Componente Comentario
@param site [Site]
@param form [String]
@param profile [Hash]
@param comment [Hash]
@param activity_pub [ActivityPub]
- in_reply_to = text_plain comment['inReplyTo']
:ruby
begin
if in_reply_to && (remote_object = object.referenced(site)['inReplyTo'])
in_reply_to = ActivityPub.url_from_object(remote_object)
end
rescue Exception => e
ExceptionNotifier.notify_exception(e, data: { site: site.name, object: comment })
end
- summary = text_plain comment['summary']
-# @todo Generar un desplegable con todas las opciones
- url = text_plain ActivityPub.url_from_object(comment)

View file

@ -13,4 +13,4 @@
%h4= t('moderation_queue.nothing')
- moderation_queue.each do |activity_pub|
%hr
= render 'moderation_queue/comment', comment: activity_pub.object.content, profile: activity_pub.actor.content, activity_pub: activity_pub, form: form_id
= render 'moderation_queue/comment', comment: activity_pub.object.content, profile: activity_pub.actor.content, activity_pub: activity_pub, form: form_id, site: site, object: activity_pub.object