* #609 ローカルユーザー設定から購読許可を削除 * Fix test * Fix test
This commit is contained in:
parent
ec60b68608
commit
0c37295624
16 changed files with 34 additions and 146 deletions
|
@ -32,7 +32,6 @@ class Api::V1::Accounts::CredentialsController < Api::BaseController
|
|||
:bot,
|
||||
:discoverable,
|
||||
:searchability,
|
||||
:dissubscribable,
|
||||
:hide_collections,
|
||||
:indexable,
|
||||
fields_attributes: [:name, :value]
|
||||
|
|
|
@ -18,7 +18,7 @@ class Settings::PrivacyExtraController < Settings::BaseController
|
|||
private
|
||||
|
||||
def account_params
|
||||
params.require(:account).permit(:subscription_policy, settings: UserSettings.keys)
|
||||
params.require(:account).permit(settings: UserSettings.keys)
|
||||
end
|
||||
|
||||
def set_account
|
||||
|
|
|
@ -20,8 +20,7 @@ class Settings::ProfilesController < Settings::BaseController
|
|||
private
|
||||
|
||||
def account_params
|
||||
# params.require(:account).permit(:display_name, :note, :bio_markdown, :avatar, :header, :locked, :my_actor_type, :searchability, :dissubscribable, :discoverable, :discoverable_local, :hide_collections, fields_attributes: [:name, :value])
|
||||
params.require(:account).permit(:display_name, :note, :bio_markdown, :avatar, :header, :bot, :my_actor_type, :dissubscribable, fields_attributes: [:name, :value])
|
||||
params.require(:account).permit(:display_name, :note, :bio_markdown, :avatar, :header, :bot, :my_actor_type, fields_attributes: [:name, :value])
|
||||
end
|
||||
|
||||
def set_account
|
||||
|
|
|
@ -242,17 +242,6 @@ class ActivityPub::TagManager
|
|||
end
|
||||
end
|
||||
|
||||
def subscribable_by(account)
|
||||
case account.subscription_policy
|
||||
when :allow
|
||||
[COLLECTIONS[:public]]
|
||||
when :followers_only
|
||||
[account_followers_url(account)]
|
||||
else
|
||||
[]
|
||||
end
|
||||
end
|
||||
|
||||
def searchable_by(status)
|
||||
searchable_by =
|
||||
case status.compute_searchability_activitypub
|
||||
|
|
|
@ -5,6 +5,8 @@ module Account::MasterSettings
|
|||
|
||||
included do
|
||||
def subscription_policy
|
||||
return :allow if local?
|
||||
|
||||
return master_settings['subscription_policy']&.to_sym || :allow if master_settings.present?
|
||||
|
||||
# allow, followers_only, block
|
||||
|
|
|
@ -143,10 +143,6 @@ module User::HasSettings
|
|||
settings['dtl_force_searchability']&.to_sym || :unchange
|
||||
end
|
||||
|
||||
def setting_dtl_force_subscribable
|
||||
settings['dtl_force_subscribable']
|
||||
end
|
||||
|
||||
def setting_hide_statuses_count
|
||||
settings['hide_statuses_count']
|
||||
end
|
||||
|
|
|
@ -39,7 +39,6 @@ class UserSettings
|
|||
setting :slip_local_emoji_reaction, default: false
|
||||
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 :dtl_force_subscribable, default: false
|
||||
setting :lock_follow_from_bot, default: false
|
||||
setting :allow_quote, default: true
|
||||
setting :reject_send_limited_to_suspects, default: false
|
||||
|
|
|
@ -7,14 +7,14 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer
|
|||
context :security
|
||||
|
||||
context_extensions :manually_approves_followers, :featured, :also_known_as,
|
||||
:moved_to, :property_value, :discoverable, :olm, :suspended, :searchable_by, :subscribable_by,
|
||||
:moved_to, :property_value, :discoverable, :olm, :suspended, :searchable_by,
|
||||
:other_setting, :memorial, :indexable
|
||||
|
||||
attributes :id, :type, :following, :followers,
|
||||
:inbox, :outbox, :featured, :featured_tags,
|
||||
:preferred_username, :name, :summary,
|
||||
:url, :manually_approves_followers,
|
||||
:discoverable, :indexable, :published, :memorial, :searchable_by, :subscribable_by, :other_setting
|
||||
:discoverable, :indexable, :published, :memorial, :searchable_by, :other_setting
|
||||
|
||||
has_one :public_key, serializer: ActivityPub::PublicKeySerializer
|
||||
|
||||
|
@ -179,10 +179,6 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer
|
|||
ActivityPub::TagManager.instance.account_searchable_by(object)
|
||||
end
|
||||
|
||||
def subscribable_by
|
||||
ActivityPub::TagManager.instance.subscribable_by(object)
|
||||
end
|
||||
|
||||
def other_setting
|
||||
config = object.public_settings
|
||||
config.map do |k, v|
|
||||
|
|
|
@ -90,9 +90,6 @@
|
|||
label_method: ->(item) { safe_join([t("simple_form.labels.dtl_force_searchability.#{item}")]) },
|
||||
wrapper: :with_floating_label
|
||||
|
||||
.fields-group
|
||||
= ff.input :dtl_force_subscribable, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_dtl_force_subscribable'), hint: I18n.t('simple_form.hints.defaults.setting_dtl_force_subscribable')
|
||||
|
||||
%h4= t 'preferences.public_timelines'
|
||||
|
||||
.fields-group
|
||||
|
|
|
@ -36,20 +36,5 @@
|
|||
.fields-group
|
||||
= ff.input :reject_send_limited_to_suspects, kmyblue: true, as: :boolean, wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_reject_send_limited_to_suspects'), hint: I18n.t('simple_form.hints.defaults.setting_reject_send_limited_to_suspects')
|
||||
|
||||
%h4= t('privacy_extra.will_remove_settings')
|
||||
%p.hint= t('privacy_extra.will_remove_settings_hint_html')
|
||||
|
||||
.fields-group
|
||||
= f.input :subscription_policy,
|
||||
as: :radio_buttons,
|
||||
collection: %w(allow followers_only block),
|
||||
collection_wrapper_tag: 'ul',
|
||||
hint: t('simple_form.hints.defaults.subscription_policy'),
|
||||
item_wrapper_tag: 'li',
|
||||
kmyblue: true,
|
||||
label: t('simple_form.labels.defaults.subscription_policy'),
|
||||
label_method: ->(item) { safe_join([t("simple_form.labels.subscription_policy.#{item}")]) },
|
||||
wrapper: :with_floating_label
|
||||
|
||||
.actions
|
||||
= f.button :button, t('generic.save_changes'), type: :submit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue