@ -3,7 +3,7 @@
class REST :: StatusSerializer < ActiveModel :: Serializer
class REST :: StatusSerializer < ActiveModel :: Serializer
attributes :id , :created_at , :in_reply_to_id , :in_reply_to_account_id ,
attributes :id , :created_at , :in_reply_to_id , :in_reply_to_account_id ,
:sensitive , :spoiler_text , :visibility , :language ,
:sensitive , :spoiler_text , :visibility , :language ,
:uri , :content , : url , :replies_count , :reblogs_count ,
:uri , :url , :replies_count , :reblogs_count ,
:favourites_count
:favourites_count
attribute :favourited , if : :current_user?
attribute :favourited , if : :current_user?
@ -11,6 +11,9 @@ class REST::StatusSerializer < ActiveModel::Serializer
attribute :muted , if : :current_user?
attribute :muted , if : :current_user?
attribute :pinned , if : :pinnable?
attribute :pinned , if : :pinnable?
attribute :content , unless : :source_requested?
attribute :text , if : :source_requested?
belongs_to :reblog , serializer : REST :: StatusSerializer
belongs_to :reblog , serializer : REST :: StatusSerializer
belongs_to :application , if : :show_application?
belongs_to :application , if : :show_application?
belongs_to :account , serializer : REST :: AccountSerializer
belongs_to :account , serializer : REST :: AccountSerializer
@ -105,6 +108,10 @@ class REST::StatusSerializer < ActiveModel::Serializer
%w( public unlisted ) . include? ( object . visibility )
%w( public unlisted ) . include? ( object . visibility )
end
end
def source_requested?
instance_options [ :source_requested ]
end
def ordered_mentions
def ordered_mentions
object . active_mentions . to_a . sort_by ( & :id )
object . active_mentions . to_a . sort_by ( & :id )
end
end