Report modal style fix, chat updates, statusserializer revert, display name truncation
This commit is contained in:
mgabdev
2020-12-20 12:27:24 -05:00
parent 7ec426e3d8
commit 67eb9d5890
49 changed files with 369 additions and 158 deletions

View File

@@ -9,10 +9,6 @@ class REST::StatusSerializer < ActiveModel::Serializer
attribute :favourited, if: :current_user?
attribute :reblogged, if: :current_user?
attribute :account_id, if: :account_id?
attribute :group_id, if: :group_id?
attribute :preview_card_id, if: :preview_card_id?
attribute :content, unless: :source_requested?
attribute :rich_content, unless: :source_requested?
attribute :plain_markdown, unless: :source_requested?
@@ -20,15 +16,15 @@ class REST::StatusSerializer < ActiveModel::Serializer
belongs_to :reblog, serializer: REST::StatusSerializer
belongs_to :quote, serializer: REST::StatusSerializer
belongs_to :account, serializer: REST::AccountSerializer, unless: :account_id?
belongs_to :group, serializer: REST::GroupSerializer, unless: :group_id?
belongs_to :account, serializer: REST::AccountSerializer
belongs_to :group, serializer: REST::GroupSerializer
has_many :media_attachments, serializer: REST::MediaAttachmentSerializer
has_many :ordered_mentions, key: :mentions
has_many :tags
has_many :emojis, serializer: REST::CustomEmojiSerializer
has_one :preview_card, key: :card, serializer: REST::PreviewCardSerializer, unless: :preview_card_id?
has_one :preview_card, key: :card, serializer: REST::PreviewCardSerializer
has_one :preloadable_poll, key: :poll, serializer: REST::PollSerializer
def id
@@ -51,30 +47,6 @@ class REST::StatusSerializer < ActiveModel::Serializer
!current_user.nil?
end
def account_id
instance_options[:account_id]
end
def account_id?
!instance_options[:account_id].nil?
end
def group_id
instance_options[:group_id]
end
def group_id?
!instance_options[:group_id].nil?
end
def preview_card_id
instance_options[:preview_card_id]
end
def preview_card_id?
!instance_options[:preview_card_id].nil?
end
def visibility
# This visibility is masked behind "private"
# to avoid API changes because there are no