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

@ -4,7 +4,7 @@ class REST::StatusSerializer < ActiveModel::Serializer
attributes :id, :created_at, :in_reply_to_id, :in_reply_to_account_id,
:sensitive, :spoiler_text, :visibility, :language,
:uri, :url, :replies_count, :reblogs_count,
:favourites_count, :local_only
:favourites_count, :local_only, :activity_pub_type
attribute :favourited, if: :current_user?
attribute :reblogged, if: :current_user?
@ -61,6 +61,10 @@ class REST::StatusSerializer < ActiveModel::Serializer
OStatus::TagManager.instance.uri_for(object)
end
def activity_pub_type
object.activity_pub_type.to_s
end
def content
Formatter.instance.format(object)
end