Merge tag 'v1.0.5+3.2.0' into hometown-v1.0.5+3.3.0
This commit is contained in:
@ -4,7 +4,7 @@ class REST::InstanceSerializer < ActiveModel::Serializer
|
||||
include RoutingHelper
|
||||
|
||||
attributes :uri, :title, :short_description, :description, :email,
|
||||
:version, :urls, :stats, :thumbnail,
|
||||
:version, :urls, :stats, :thumbnail, :max_toot_chars,
|
||||
:languages, :registrations, :approval_required, :invites_enabled
|
||||
|
||||
has_one :contact_account, serializer: REST::AccountSerializer
|
||||
@ -39,6 +39,10 @@ class REST::InstanceSerializer < ActiveModel::Serializer
|
||||
instance_presenter.thumbnail ? full_asset_url(instance_presenter.thumbnail.file.url) : full_pack_url('media/images/preview.jpg')
|
||||
end
|
||||
|
||||
def max_toot_chars
|
||||
StatusLengthValidator::MAX_CHARS
|
||||
end
|
||||
|
||||
def stats
|
||||
{
|
||||
user_count: instance_presenter.user_count,
|
||||
|
@ -1,7 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class REST::ListSerializer < ActiveModel::Serializer
|
||||
attributes :id, :title, :replies_policy
|
||||
attributes :id, :title, :replies_policy, :is_exclusive
|
||||
|
||||
def id
|
||||
object.id.to_s
|
||||
|
@ -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?
|
||||
@ -70,6 +70,10 @@ class REST::StatusSerializer < ActiveModel::Serializer
|
||||
ActivityPub::TagManager.instance.uri_for(object)
|
||||
end
|
||||
|
||||
def activity_pub_type
|
||||
object.activity_pub_type.to_s
|
||||
end
|
||||
|
||||
def content
|
||||
Formatter.instance.format(object)
|
||||
end
|
||||
|
Reference in New Issue
Block a user