Remove: kmyblue独自機能の引用
This commit is contained in:
parent
620a895184
commit
d845d1e9fb
70 changed files with 812 additions and 1788 deletions
|
@ -3,7 +3,7 @@
|
|||
class ActivityPub::NoteSerializer < ActivityPub::Serializer
|
||||
include FormattingHelper
|
||||
|
||||
context_extensions :atom_uri, :conversation, :sensitive, :voters_count, :searchable_by, :references, :limited_scope, :quote_uri
|
||||
context_extensions :atom_uri, :conversation, :sensitive, :voters_count, :searchable_by, :references, :limited_scope
|
||||
|
||||
attributes :id, :type, :summary,
|
||||
:in_reply_to, :published, :url,
|
||||
|
@ -16,9 +16,6 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
|
|||
attribute :updated, if: :edited?
|
||||
attribute :limited_scope, if: :limited_visibility?
|
||||
|
||||
attribute :quote_uri, if: :quote?
|
||||
attribute :misskey_quote, key: :_misskey_quote, if: :quote?
|
||||
|
||||
has_many :virtual_attachments, key: :attachment
|
||||
has_many :virtual_tags, key: :tag
|
||||
|
||||
|
@ -158,30 +155,7 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
|
|||
end
|
||||
|
||||
def virtual_tags
|
||||
object.active_mentions.to_a.sort_by(&:id) + object.tags + object.emojis + virtual_tags_of_quote
|
||||
end
|
||||
|
||||
class NoteLink < ActiveModelSerializers::Model
|
||||
attributes :href
|
||||
end
|
||||
|
||||
class NoteLinkSerializer < ActivityPub::Serializer
|
||||
attributes :type, :href
|
||||
attribute :media_type, key: :mediaType
|
||||
|
||||
def type
|
||||
'Link'
|
||||
end
|
||||
|
||||
def media_type
|
||||
'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'
|
||||
end
|
||||
end
|
||||
|
||||
def virtual_tags_of_quote
|
||||
return [] unless object.quote?
|
||||
|
||||
[NoteLink.new(href: quote_uri)]
|
||||
object.active_mentions.to_a.sort_by(&:id) + object.tags + object.emojis
|
||||
end
|
||||
|
||||
def atom_uri
|
||||
|
@ -218,20 +192,6 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
|
|||
object.account.local?
|
||||
end
|
||||
|
||||
delegate :quote?, to: :object
|
||||
|
||||
def quote_post
|
||||
@quote_post ||= object.quote
|
||||
end
|
||||
|
||||
def quote_uri
|
||||
ActivityPub::TagManager.instance.uri_for(quote_post)
|
||||
end
|
||||
|
||||
def misskey_quote
|
||||
quote_uri
|
||||
end
|
||||
|
||||
def poll_options
|
||||
object.preloadable_poll.loaded_options
|
||||
end
|
||||
|
|
|
@ -40,14 +40,10 @@ class InitialStateSerializer < ActiveModel::Serializer
|
|||
store[:hide_items] = [
|
||||
object_account_user.setting_hide_favourite_menu ? 'favourite_menu' : nil,
|
||||
object_account_user.setting_hide_recent_emojis ? 'recent_emojis' : nil,
|
||||
object_account_user.setting_hide_blocking_quote ? 'blocking_quote' : nil,
|
||||
object_account_user.setting_hide_emoji_reaction_unavailable_server ? 'emoji_reaction_unavailable_server' : nil,
|
||||
object_account_user.setting_hide_quote_unavailable_server ? 'quote_unavailable_server' : nil,
|
||||
object_account_user.setting_hide_status_reference_unavailable_server ? 'status_reference_unavailable_server' : nil,
|
||||
object_account_user.setting_hide_emoji_reaction_count ? 'emoji_reaction_count' : nil,
|
||||
object_account_user.setting_show_emoji_reaction_on_timeline ? nil : 'emoji_reaction_on_timeline',
|
||||
object_account_user.setting_show_quote_in_home ? nil : 'quote_in_home',
|
||||
object_account_user.setting_show_quote_in_public ? nil : 'quote_in_public',
|
||||
object_account_user.setting_show_relationships ? nil : 'relationships',
|
||||
object_account_user.setting_show_avatar_on_filter ? nil : 'avatar_on_filter',
|
||||
].compact
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class REST::FilterSerializer < ActiveModel::Serializer
|
||||
attributes :id, :title, :exclude_follows, :exclude_localusers, :with_quote, :with_profile, :context, :expires_at, :filter_action
|
||||
attributes :id, :title, :exclude_follows, :exclude_localusers, :with_profile, :context, :expires_at, :filter_action
|
||||
has_many :keywords, serializer: REST::FilterKeywordSerializer, if: :rules_requested?
|
||||
has_many :statuses, serializer: REST::FilterStatusSerializer, if: :rules_requested?
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ class REST::StatusSerializer < ActiveModel::Serializer
|
|||
attribute :pinned, if: :pinnable?
|
||||
attribute :reactions, if: :reactions?
|
||||
attribute :expires_at, if: :will_expire?
|
||||
attribute :quote_id, if: :quote?
|
||||
attribute :markdown_opt, key: :markdown
|
||||
has_many :filtered, serializer: REST::FilterResultSerializer, if: :current_user?
|
||||
|
||||
|
@ -37,23 +36,6 @@ class REST::StatusSerializer < ActiveModel::Serializer
|
|||
has_one :preview_card, key: :card, serializer: REST::PreviewCardSerializer
|
||||
has_one :preloadable_poll, key: :poll, serializer: REST::PollSerializer
|
||||
|
||||
class QuotedStatusSerializer < REST::StatusSerializer
|
||||
attribute :quote_muted, if: :current_user?
|
||||
|
||||
def quote
|
||||
nil
|
||||
end
|
||||
|
||||
def quote_muted
|
||||
if relationships
|
||||
muted || relationships.blocks_map[object.account_id] || relationships.domain_blocks_map[object.account.domain] || false
|
||||
else
|
||||
muted || current_user.account.blocking?(object.account_id) || current_user.account.domain_blocking?(object.account.domain)
|
||||
end
|
||||
end
|
||||
end
|
||||
belongs_to :quote, if: :quote?, serializer: QuotedStatusSerializer, relationships: -> { relationships }
|
||||
|
||||
def id
|
||||
object.id.to_s
|
||||
end
|
||||
|
@ -182,12 +164,6 @@ class REST::StatusSerializer < ActiveModel::Serializer
|
|||
end
|
||||
end
|
||||
|
||||
def quote_id
|
||||
object.quote_of_id.to_s
|
||||
end
|
||||
|
||||
delegate :quote?, to: :object
|
||||
|
||||
def reblogged
|
||||
if relationships
|
||||
relationships.reblogs_map[object.id] || false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue