Adding full Article support

This creates a new column in the `statuses` table which keeps track of
activity_pub_type, so in the case of a Note it will be blank (the
default) and it will be a string "Article" if the received remote object
is an AP Article. There is now a bunch of special case code in the
formatters and sanitizers to handle Articles differently, as well as on
the clientside.
This commit is contained in:
Darius Kazemi
2019-05-05 16:59:04 -07:00
parent b3e65978b4
commit 0436aa9984
8 changed files with 34 additions and 9 deletions

View File

@ -60,7 +60,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
account: @account,
text: text_from_content || '',
language: detected_language,
spoiler_text: converted_object_type? ? '' : (text_from_summary || ''),
spoiler_text: converted_object_type? ? '' : (text_from_summary || (@object['type'] == 'Article' && text_from_name) || ''),
created_at: @object['published'],
override_timestamps: @options[:override_timestamps],
reply: @object['inReplyTo'].present?,
@ -70,6 +70,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,
activity_pub_type: @object['type']
}
end
end