activitypub: resolve quoted objects when new create activities are received
parent
6b07407820
commit
968bd6f0ee
|
@ -126,6 +126,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
||||||
conversation: conversation_from_uri(@object['conversation']),
|
conversation: conversation_from_uri(@object['conversation']),
|
||||||
media_attachment_ids: process_attachments.take(4).map(&:id),
|
media_attachment_ids: process_attachments.take(4).map(&:id),
|
||||||
poll: process_poll,
|
poll: process_poll,
|
||||||
|
quote: quote_from_url(@object['quoteUrl']),
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -426,4 +427,11 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
||||||
poll.reload
|
poll.reload
|
||||||
retry
|
retry
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def quote_from_url(url)
|
||||||
|
return nil if url.nil?
|
||||||
|
|
||||||
|
quote = ResolveURLService.new.call(url)
|
||||||
|
status_from_uri(quote.uri) if quote
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue