forked from treehouse/mastodon
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']),
|
||||
media_attachment_ids: process_attachments.take(4).map(&:id),
|
||||
poll: process_poll,
|
||||
quote: quote_from_url(@object['quoteUrl']),
|
||||
}
|
||||
end
|
||||
end
|
||||
|
@ -426,4 +427,11 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||
poll.reload
|
||||
retry
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue