Merge tag 'v3.1.1' into instance_only_statuses
This commit is contained in:
@ -9,6 +9,7 @@ class REST::StatusSerializer < ActiveModel::Serializer
|
||||
attribute :favourited, if: :current_user?
|
||||
attribute :reblogged, if: :current_user?
|
||||
attribute :muted, if: :current_user?
|
||||
attribute :bookmarked, if: :current_user?
|
||||
attribute :pinned, if: :pinnable?
|
||||
|
||||
attribute :content, unless: :source_requested?
|
||||
@ -93,6 +94,14 @@ class REST::StatusSerializer < ActiveModel::Serializer
|
||||
end
|
||||
end
|
||||
|
||||
def bookmarked
|
||||
if instance_options && instance_options[:relationships]
|
||||
instance_options[:relationships].bookmarks_map[object.id] || false
|
||||
else
|
||||
current_user.account.bookmarked?(object)
|
||||
end
|
||||
end
|
||||
|
||||
def pinned
|
||||
if instance_options && instance_options[:relationships]
|
||||
instance_options[:relationships].pins_map[object.id] || false
|
||||
@ -136,7 +145,7 @@ class REST::StatusSerializer < ActiveModel::Serializer
|
||||
end
|
||||
|
||||
def acct
|
||||
object.account_acct
|
||||
object.account.pretty_acct
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user