Merge tag 'v3.1.4' into hometown-dev
This commit is contained in:
@ -7,6 +7,7 @@ class REST::AnnouncementSerializer < ActiveModel::Serializer
|
||||
attribute :read, if: :current_user?
|
||||
|
||||
has_many :mentions
|
||||
has_many :statuses
|
||||
has_many :tags, serializer: REST::StatusSerializer::TagSerializer
|
||||
has_many :emojis, serializer: REST::CustomEmojiSerializer
|
||||
has_many :reactions, serializer: REST::ReactionSerializer
|
||||
@ -46,4 +47,16 @@ class REST::AnnouncementSerializer < ActiveModel::Serializer
|
||||
object.pretty_acct
|
||||
end
|
||||
end
|
||||
|
||||
class StatusSerializer < ActiveModel::Serializer
|
||||
attributes :id, :url
|
||||
|
||||
def id
|
||||
object.id.to_s
|
||||
end
|
||||
|
||||
def url
|
||||
ActivityPub::TagManager.instance.url_for(object)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -5,7 +5,7 @@ class REST::InstanceSerializer < ActiveModel::Serializer
|
||||
|
||||
attributes :uri, :title, :short_description, :description, :email,
|
||||
:version, :urls, :stats, :thumbnail,
|
||||
:languages, :registrations, :approval_required
|
||||
:languages, :registrations, :approval_required, :invites_enabled
|
||||
|
||||
has_one :contact_account, serializer: REST::AccountSerializer
|
||||
|
||||
@ -63,6 +63,10 @@ class REST::InstanceSerializer < ActiveModel::Serializer
|
||||
Setting.registrations_mode == 'approved'
|
||||
end
|
||||
|
||||
def invites_enabled
|
||||
Setting.min_invite_role == 'user'
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def instance_presenter
|
||||
|
||||
@ -12,7 +12,9 @@ class REST::MediaAttachmentSerializer < ActiveModel::Serializer
|
||||
end
|
||||
|
||||
def url
|
||||
if object.needs_redownload?
|
||||
if object.not_processed?
|
||||
nil
|
||||
elsif object.needs_redownload?
|
||||
media_proxy_url(object.id, :original)
|
||||
else
|
||||
full_asset_url(object.file.url(:original))
|
||||
|
||||
Reference in New Issue
Block a user