Merge commit '9ffe6817e0
' into kb_migration
This commit is contained in:
commit
db5c358f4f
54 changed files with 155 additions and 79 deletions
|
@ -3,13 +3,13 @@
|
|||
class REST::CustomEmojiSerializer < ActiveModel::Serializer
|
||||
include RoutingHelper
|
||||
|
||||
attributes :shortcode, :url, :static_url, :visible_in_picker, :is_sensitive
|
||||
attributes :shortcode, :url, :static_url, :visible_in_picker
|
||||
|
||||
attribute :category, if: :category_loaded?
|
||||
attribute :width, if: :width?
|
||||
attribute :height, if: :height?
|
||||
attribute :aliases, if: :aliases?
|
||||
attribute :is_sensitive, if: :is_sensitive?
|
||||
attribute :sensitive, if: :sensitive?
|
||||
|
||||
def url
|
||||
full_asset_url(object.image.url)
|
||||
|
@ -47,7 +47,11 @@ class REST::CustomEmojiSerializer < ActiveModel::Serializer
|
|||
object.respond_to?(:aliases) && object.aliases.present?
|
||||
end
|
||||
|
||||
def is_sensitive? # rubocop:disable Naming/PredicateName
|
||||
def sensitive?
|
||||
object.respond_to?(:is_sensitive)
|
||||
end
|
||||
|
||||
def sensitive
|
||||
object.is_sensitive
|
||||
end
|
||||
end
|
||||
|
|
|
@ -57,7 +57,7 @@ class REST::StatusSerializer < ActiveModel::Serializer
|
|||
# UX differences
|
||||
if object.limited_visibility?
|
||||
'private'
|
||||
elsif object.public_unlisted_visibility?
|
||||
elsif object.public_unlisted_visibility? || object.login_visibility?
|
||||
'public'
|
||||
else
|
||||
object.visibility
|
||||
|
@ -159,7 +159,7 @@ class REST::StatusSerializer < ActiveModel::Serializer
|
|||
current_user? &&
|
||||
current_user.account_id == object.account_id &&
|
||||
!object.reblog? &&
|
||||
%w(public unlisted public_unlisted private).include?(object.visibility)
|
||||
%w(public unlisted public_unlisted login private).include?(object.visibility)
|
||||
end
|
||||
|
||||
def reactions?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue