1
0
Fork 0
forked from gitea/nas

Remove: kmyblue独自機能の引用

This commit is contained in:
KMY 2025-04-24 08:48:28 +09:00
parent 620a895184
commit d845d1e9fb
70 changed files with 812 additions and 1788 deletions

View file

@ -15,13 +15,6 @@ module Account::OtherSettings
false
end
def allow_quote?
return user.setting_allow_quote if local? && user.present?
return settings['allow_quote'] if settings.present? && settings.key?('allow_quote')
true
end
def hide_statuses_count?
return user&.setting_hide_statuses_count if local? && user.present?
return settings['hide_statuses_count'] if settings.present? && settings.key?('hide_statuses_count')
@ -88,7 +81,6 @@ module Account::OtherSettings
'hide_following_count' => hide_following_count?,
'hide_followers_count' => hide_followers_count?,
'translatable_private' => translatable_private?,
'allow_quote' => allow_quote?,
'emoji_reaction_policy' => Setting.enable_emoji_reaction ? emoji_reaction_policy.to_s : 'block',
}
end

View file

@ -107,18 +107,6 @@ module User::HasSettings
settings['web.content_font_size']
end
def setting_show_quote_in_home
settings['web.show_quote_in_home']
end
def setting_show_quote_in_public
settings['web.show_quote_in_public']
end
def setting_hide_blocking_quote
settings['web.hide_blocking_quote']
end
def setting_show_relationships
settings['web.show_relationships']
end
@ -127,10 +115,6 @@ module User::HasSettings
settings['web.show_avatar_on_filter']
end
def setting_allow_quote
settings['allow_quote']
end
def setting_reject_send_limited_to_suspects
settings['reject_send_limited_to_suspects']
end
@ -259,10 +243,6 @@ module User::HasSettings
settings['use_public_index']
end
def setting_reverse_search_quote
settings['reverse_search_quote']
end
def setting_disallow_unlisted_public_searchability
settings['disallow_unlisted_public_searchability']
end
@ -275,10 +255,6 @@ module User::HasSettings
settings['web.hide_emoji_reaction_unavailable_server']
end
def setting_hide_quote_unavailable_server
settings['web.hide_quote_unavailable_server']
end
def setting_hide_status_reference_unavailable_server
settings['web.hide_status_reference_unavailable_server']
end

View file

@ -12,7 +12,6 @@
# expires_at :datetime
# phrase :text default(""), not null
# with_profile :boolean default(FALSE), not null
# with_quote :boolean default(TRUE), not null
# created_at :datetime not null
# updated_at :datetime not null
# account_id :bigint(8) not null
@ -69,14 +68,6 @@ class CustomFilter < ApplicationRecord
hide_action?
end
def exclude_quote=(value)
self.with_quote = !ActiveModel::Type::Boolean.new.cast(value)
end
def exclude_quote
!with_quote
end
def exclude_profile=(value)
self.with_profile = !ActiveModel::Type::Boolean.new.cast(value)
end
@ -111,9 +102,6 @@ class CustomFilter < ApplicationRecord
end
def self.apply_cached_filters(cached_filters, status, following: false)
references_text_cache = nil
references_spoiler_text_cache = nil
cached_filters.filter_map do |filter, rules|
next if filter.exclude_follows && following
next if filter.exclude_localusers && status.account.local?
@ -121,17 +109,10 @@ class CustomFilter < ApplicationRecord
if rules[:keywords].present?
match = rules[:keywords].match(status.proper.searchable_text)
match = rules[:keywords].match([status.account.display_name, status.account.note].join("\n\n")) if !match && filter.with_profile
if match.nil? && filter.with_quote && status.proper.reference_objects.exists?
references_text_cache = status.proper.references.pluck(:text).join("\n\n") if references_text_cache.nil?
references_spoiler_text_cache = status.proper.references.pluck(:spoiler_text).join("\n\n") if references_spoiler_text_cache.nil?
match = rules[:keywords].match(references_text_cache)
match = rules[:keywords].match(references_spoiler_text_cache) if match.nil?
end
end
keyword_matches = [match.to_s] unless match.nil?
reference_ids = filter.with_quote ? status.proper.reference_objects.pluck(:target_status_id) : []
status_matches = ([status.id, status.reblog_of_id] + reference_ids).compact & rules[:status_ids] if rules[:status_ids].present?
status_matches = [status.id, status.reblog_of_id].compact & rules[:status_ids] if rules[:status_ids].present?
next if keyword_matches.blank? && status_matches.blank?

View file

@ -35,8 +35,6 @@ class InstanceInfo < ApplicationRecord
yojo-art
).freeze
QUOTE_AVAILABLE_SOFTWARES = EMOJI_REACTION_AVAILABLE_SOFTWARES + %w(bridgy-fed).freeze
STATUS_REFERENCE_AVAILABLE_SOFTWARES = %w(fedibird).freeze
CIRCLE_AVAILABLE_SOFTWARES = %w(fedibird).freeze
@ -87,7 +85,6 @@ class InstanceInfo < ApplicationRecord
{
emoji_reaction: feature_available?(info, EMOJI_REACTION_AVAILABLE_SOFTWARES, 'emoji_reaction'),
quote: feature_available?(info, QUOTE_AVAILABLE_SOFTWARES, 'quote'),
status_reference: feature_available?(info, STATUS_REFERENCE_AVAILABLE_SOFTWARES, 'status_reference'),
circle: feature_available?(info, CIRCLE_AVAILABLE_SOFTWARES, 'circle'),
}
@ -96,7 +93,6 @@ class InstanceInfo < ApplicationRecord
def local_features
{
emoji_reaction: Setting.enable_emoji_reaction,
quote: true,
status_reference: true,
circle: true,
}

View file

@ -205,19 +205,6 @@ class Status < ApplicationRecord
account: [:account_stat, user: :role],
active_mentions: { account: :account_stat },
],
quote: [
:application,
:tags,
:media_attachments,
:conversation,
:status_stat,
:preloadable_poll,
:reference_objects,
:scheduled_expiration_status,
preview_cards_status: { preview_card: { author_account: [:account_stat, user: :role] } },
account: [:account_stat, user: :role],
active_mentions: :account,
],
thread: :account
delegate :domain, to: :account, prefix: true
@ -252,10 +239,6 @@ class Status < ApplicationRecord
!reblog_of_id.nil?
end
def quote?
!quote_of_id.nil? && !quote.nil?
end
def expires?
scheduled_expiration_status.present?
end

View file

@ -5,12 +5,11 @@
# Table name: status_references
#
# id :bigint(8) not null, primary key
# status_id :bigint(8) not null
# target_status_id :bigint(8) not null
# attribute_type :string
# created_at :datetime not null
# updated_at :datetime not null
# attribute_type :string
# quote :boolean default(FALSE), not null
# status_id :bigint(8) not null
# target_status_id :bigint(8) not null
#
class StatusReference < ApplicationRecord
@ -22,8 +21,6 @@ class StatusReference < ApplicationRecord
has_one :notification, as: :activity, dependent: :destroy
after_commit :reset_parent_cache
after_create_commit :set_quote
after_destroy_commit :remove_quote
private
@ -31,18 +28,4 @@ class StatusReference < ApplicationRecord
Rails.cache.delete("statuses/#{status_id}")
Rails.cache.delete("statuses/#{target_status_id}")
end
def set_quote
return unless quote
return if status.quote_of_id.present?
status.quote_of_id = target_status_id
end
def remove_quote
return unless quote
return unless status.quote_of_id == target_status_id
status.quote_of_id = nil
end
end

View file

@ -27,7 +27,6 @@ class UserSettings
setting :default_searchability, default: :direct, in: %w(public private direct limited public_unlisted)
setting :default_searchability_of_search, default: :public, in: %w(public private direct limited)
setting :use_public_index, default: true
setting :reverse_search_quote, default: false
setting :disallow_unlisted_public_searchability, default: false
setting :public_post_to_unlisted, default: false
setting :reject_public_unlisted_subscription, default: false
@ -40,7 +39,6 @@ class UserSettings
setting :dtl_force_visibility, default: :unchange, in: %w(unchange public public_unlisted unlisted)
setting :dtl_force_searchability, default: :unchange, in: %w(unchange public public_unlisted)
setting :lock_follow_from_bot, default: false
setting :allow_quote, default: true
setting :reject_send_limited_to_suspects, default: false
setting_inverse_alias :indexable, :noindex
@ -75,18 +73,12 @@ class UserSettings
setting :auto_play, default: true
setting :simple_timeline_menu, default: false
setting :boost_menu, default: false
setting :show_quote_in_home, default: true
setting :show_quote_in_public, default: false
setting :show_relationships, default: true
setting :hide_blocking_quote, default: true
setting :hide_emoji_reaction_unavailable_server, default: false
setting :hide_quote_unavailable_server, default: false
setting :hide_status_reference_unavailable_server, default: false
setting :hide_favourite_menu, default: false
setting :hide_emoji_reaction_count, default: false
setting :show_avatar_on_filter, default: true
setting_inverse_alias :'web.show_blocking_quote', :'web.hide_blocking_quote'
setting_inverse_alias :'web.show_emoji_reaction_count', :'web.hide_emoji_reaction_count'
setting_inverse_alias :'web.show_favourite_menu', :'web.hide_favourite_menu'
setting_inverse_alias :'web.show_recent_emojis', :'web.hide_recent_emojis'