5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-10-09 16:26:56 +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? def object_type?
true true
end 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
end end

View file

@ -1,12 +1,21 @@
-# -#
Componente Comentario Componente Comentario
@param site [Site]
@param form [String] @param form [String]
@param profile [Hash] @param profile [Hash]
@param comment [Hash] @param comment [Hash]
@param activity_pub [ActivityPub] @param activity_pub [ActivityPub]
- in_reply_to = text_plain comment['inReplyTo'] - 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'] - summary = text_plain comment['summary']
-# @todo Generar un desplegable con todas las opciones -# @todo Generar un desplegable con todas las opciones
- url = text_plain ActivityPub.url_from_object(comment) - url = text_plain ActivityPub.url_from_object(comment)

View file

@ -13,4 +13,4 @@
%h4= t('moderation_queue.nothing') %h4= t('moderation_queue.nothing')
- moderation_queue.each do |activity_pub| - moderation_queue.each do |activity_pub|
%hr %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