Merge commit 'f826a95f6e' into kb_migration

This commit is contained in:
KMY 2023-07-25 15:09:10 +09:00
commit 4b65740722
211 changed files with 628 additions and 599 deletions

View file

@ -100,7 +100,7 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer
end
def name
object.suspended? ? '' : object.display_name
object.suspended? ? object.username : (object.display_name.presence || object.username)
end
def summary

View file

@ -51,13 +51,11 @@ class InitialStateSerializer < ActiveModel::Serializer
store[:use_blurhash] = object.current_account.user.setting_use_blurhash
store[:use_pending_items] = object.current_account.user.setting_use_pending_items
store[:show_trends] = Setting.trends && object.current_account.user.setting_trends
store[:crop_images] = object.current_account.user.setting_crop_images
else
store[:auto_play_gif] = Setting.auto_play_gif
store[:display_media] = Setting.display_media
store[:reduce_motion] = Setting.reduce_motion
store[:use_blurhash] = Setting.use_blurhash
store[:crop_images] = Setting.crop_images
end
store[:disabled_account_id] = object.disabled_account.id.to_s if object.disabled_account

View file

@ -6,7 +6,7 @@ class REST::PreviewCardSerializer < ActiveModel::Serializer
attributes :url, :title, :description, :language, :type,
:author_name, :author_url, :provider_name,
:provider_url, :html, :width, :height,
:image, :embed_url, :blurhash
:image, :embed_url, :blurhash, :published_at
def image
object.image? ? full_asset_url(object.image.url(:original)) : nil
@ -15,4 +15,8 @@ class REST::PreviewCardSerializer < ActiveModel::Serializer
def html
Sanitize.fragment(object.html, Sanitize::Config::MASTODON_OEMBED)
end
def published_at
object.created_at
end
end