From 9f0f2478ebf36c9e3f4412497bfee00d024b8f6a Mon Sep 17 00:00:00 2001 From: KMY Date: Sun, 1 Oct 2023 20:37:10 +0900 Subject: [PATCH] =?UTF-8?q?=E5=8F=82=E7=85=A7=EF=BC=91=E3=81=A4=E3=81=AE?= =?UTF-8?q?=E5=A0=B4=E5=90=88=E3=81=AF=E5=BC=95=E7=94=A8=E3=81=AB=E5=A4=89?= =?UTF-8?q?=E6=8F=9B=E3=81=99=E3=82=8B=E8=A8=AD=E5=AE=9A=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/concerns/has_user_settings.rb | 4 ---- app/models/user_settings.rb | 1 - app/serializers/activitypub/note_serializer.rb | 6 ++---- app/views/settings/preferences/other/show.html.haml | 3 --- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/app/models/concerns/has_user_settings.rb b/app/models/concerns/has_user_settings.rb index 815cae80e6404e..d28eeaf54494b1 100644 --- a/app/models/concerns/has_user_settings.rb +++ b/app/models/concerns/has_user_settings.rb @@ -139,10 +139,6 @@ def setting_link_preview settings['link_preview'] end - def setting_single_ref_to_quote - settings['single_ref_to_quote'] - end - def setting_dtl_force_with_tag settings['dtl_force_with_tag']&.to_sym || :none end diff --git a/app/models/user_settings.rb b/app/models/user_settings.rb index af48df66dd0357..6d3acc43fa1641 100644 --- a/app/models/user_settings.rb +++ b/app/models/user_settings.rb @@ -41,7 +41,6 @@ class KeyError < Error; end setting :dtl_force_with_tag, default: :none, in: %w(full searchability none) setting :dtl_force_subscribable, default: false setting :lock_follow_from_bot, default: false - setting :single_ref_to_quote, default: false setting :allow_quote, default: true setting_inverse_alias :indexable, :noindex diff --git a/app/serializers/activitypub/note_serializer.rb b/app/serializers/activitypub/note_serializer.rb index d8f7a328ed7a22..3c89c7b632f9b4 100644 --- a/app/serializers/activitypub/note_serializer.rb +++ b/app/serializers/activitypub/note_serializer.rb @@ -170,12 +170,10 @@ def local? object.account.local? end - def quote? - @quote ||= (object.reference_objects.count == 1 && object.account.user&.settings&.[]('single_ref_to_quote')) || object.reference_objects.where(attribute_type: 'QT').count == 1 - end + delegate :quote?, to: :object def quote_post - @quote_post ||= object.quote || object.references.first + @quote_post ||= object.quote end def quote_uri diff --git a/app/views/settings/preferences/other/show.html.haml b/app/views/settings/preferences/other/show.html.haml index c596013ef6c569..353715df01a66e 100644 --- a/app/views/settings/preferences/other/show.html.haml +++ b/app/views/settings/preferences/other/show.html.haml @@ -14,9 +14,6 @@ .fields-group = ff.input :lock_follow_from_bot, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_lock_follow_from_bot') - .fields-group - = ff.input :single_ref_to_quote, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_single_ref_to_quote'), hint: I18n.t('simple_form.hints.defaults.setting_single_ref_to_quote') - %h4= t 'preferences.posting_defaults' .fields-row