Add expiration/limited/reference icon on timeline
This commit is contained in:
parent
1de5ee1deb
commit
1f6047a43f
2 changed files with 16 additions and 0 deletions
|
@ -15,6 +15,7 @@ class REST::StatusSerializer < ActiveModel::Serializer
|
|||
attribute :bookmarked, if: :current_user?
|
||||
attribute :pinned, if: :pinnable?
|
||||
attribute :reactions, if: :reactions?
|
||||
attribute :expires_at, if: :will_expire?
|
||||
has_many :filtered, serializer: REST::FilterResultSerializer, if: :current_user?
|
||||
|
||||
attribute :content, unless: :source_requested?
|
||||
|
@ -205,6 +206,14 @@ class REST::StatusSerializer < ActiveModel::Serializer
|
|||
object.active_mentions.to_a.sort_by(&:id)
|
||||
end
|
||||
|
||||
def will_expire?
|
||||
object.scheduled_expiration_status.present?
|
||||
end
|
||||
|
||||
def expires_at
|
||||
object.scheduled_expiration_status.scheduled_at
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def relationships
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue