mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-23 04:16:21 +00:00
feat: referenciar objetos #15642
This commit is contained in:
parent
1623d618ee
commit
7b87aaa93d
3 changed files with 19 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue