Merge branch 'main' into glitch-soc/merge-upstream
Conflicts: - `package.json`: Not really a conflict, upstream updated a dependency textually adjacent to a glitch-soc-only one. Updated the dependency as upstream did.
This commit is contained in:
@ -13,6 +13,7 @@ class REST::AccountSerializer < ActiveModel::Serializer
|
||||
has_many :emojis, serializer: REST::CustomEmojiSerializer
|
||||
|
||||
attribute :suspended, if: :suspended?
|
||||
attribute :silenced, key: :limited, if: :silenced?
|
||||
|
||||
class FieldSerializer < ActiveModel::Serializer
|
||||
include FormattingHelper
|
||||
@ -102,7 +103,11 @@ class REST::AccountSerializer < ActiveModel::Serializer
|
||||
object.suspended?
|
||||
end
|
||||
|
||||
delegate :suspended?, to: :object
|
||||
def silenced
|
||||
object.silenced?
|
||||
end
|
||||
|
||||
delegate :suspended?, :silenced?, to: :object
|
||||
|
||||
def moved_and_not_nested?
|
||||
object.moved? && object.moved_to_account.moved_to_account_id.nil?
|
||||
|
@ -1,28 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class RSS::AccountSerializer < RSS::Serializer
|
||||
include ActionView::Helpers::NumberHelper
|
||||
include AccountsHelper
|
||||
include RoutingHelper
|
||||
|
||||
def render(account, statuses, tag)
|
||||
builder = RSSBuilder.new
|
||||
|
||||
builder.title("#{display_name(account)} (@#{account.local_username_and_domain})")
|
||||
.description(account_description(account))
|
||||
.link(tag.present? ? short_account_tag_url(account, tag) : short_account_url(account))
|
||||
.logo(full_pack_url('media/images/logo.svg'))
|
||||
.accent_color('2b90d9')
|
||||
|
||||
builder.image(full_asset_url(account.avatar.url(:original))) if account.avatar?
|
||||
builder.cover(full_asset_url(account.header.url(:original))) if account.header?
|
||||
|
||||
render_statuses(builder, statuses)
|
||||
|
||||
builder.to_xml
|
||||
end
|
||||
|
||||
def self.render(account, statuses, tag)
|
||||
new.render(account, statuses, tag)
|
||||
end
|
||||
end
|
@ -1,25 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class RSS::TagSerializer < RSS::Serializer
|
||||
include ActionView::Helpers::NumberHelper
|
||||
include ActionView::Helpers::SanitizeHelper
|
||||
include RoutingHelper
|
||||
|
||||
def render(tag, statuses)
|
||||
builder = RSSBuilder.new
|
||||
|
||||
builder.title("##{tag.name}")
|
||||
.description(strip_tags(I18n.t('about.about_hashtag_html', hashtag: tag.name)))
|
||||
.link(tag_url(tag))
|
||||
.logo(full_pack_url('media/images/logo.svg'))
|
||||
.accent_color('2b90d9')
|
||||
|
||||
render_statuses(builder, statuses)
|
||||
|
||||
builder.to_xml
|
||||
end
|
||||
|
||||
def self.render(tag, statuses)
|
||||
new.render(tag, statuses)
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user