1
0
Fork 0
forked from gitea/nas

Add references activitypub support

This commit is contained in:
KMY 2023-07-11 18:31:28 +09:00
parent 4c65f2721c
commit cadfbbab96
8 changed files with 115 additions and 5 deletions

View file

@ -45,6 +45,7 @@ class ActivityPub::ProcessStatusUpdateService < BaseService
create_edits!
end
update_references!
download_media_files!
queue_poll_notifications!
@ -240,6 +241,13 @@ class ActivityPub::ProcessStatusUpdateService < BaseService
end
end
def update_references!
references = @json['references'].nil? ? [] : ActivityPub::FetchReferencesService.new.call(@json['references'])
quote = @json['quote'] || @json['quoteUrl'] || @json['quoteURL'] || @json['_misskey_quote']
references << quote if quote
ProcessReferencesWorker.perform_async(@status.id, [], references)
end
def expected_type?
equals_or_includes_any?(@json['type'], %w(Note Question))
end