Add discoverable_local setting
This commit is contained in:
parent
88339b3657
commit
790ffc1e4e
7 changed files with 25 additions and 1 deletions
|
@ -20,7 +20,7 @@ class Settings::ProfilesController < Settings::BaseController
|
||||||
private
|
private
|
||||||
|
|
||||||
def account_params
|
def account_params
|
||||||
params.require(:account).permit(:display_name, :note, :bio_markdown, :avatar, :header, :locked, :my_actor_type, :searchability, :dissubscribable, :group_allow_private_message, :discoverable, :hide_collections, fields_attributes: [:name, :value])
|
params.require(:account).permit(:display_name, :note, :bio_markdown, :avatar, :header, :locked, :my_actor_type, :searchability, :dissubscribable, :group_allow_private_message, :discoverable, :discoverable_local, :hide_collections, fields_attributes: [:name, :value])
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_account
|
def set_account
|
||||||
|
|
|
@ -111,6 +111,10 @@ module HasUserSettings
|
||||||
settings['bio_markdown']
|
settings['bio_markdown']
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def setting_discoverable_local
|
||||||
|
settings['discoverable_local']
|
||||||
|
end
|
||||||
|
|
||||||
def setting_display_media
|
def setting_display_media
|
||||||
settings['web.display_media']
|
settings['web.display_media']
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,6 +13,7 @@ class UserSettings
|
||||||
setting :noindex, default: -> { ::Setting.noindex }
|
setting :noindex, default: -> { ::Setting.noindex }
|
||||||
setting :noai, default: true
|
setting :noai, default: true
|
||||||
setting :bio_markdown, default: false
|
setting :bio_markdown, default: false
|
||||||
|
setting :discoverable_local, default: false
|
||||||
setting :hide_statuses_count, default: false
|
setting :hide_statuses_count, default: false
|
||||||
setting :hide_following_count, default: false
|
setting :hide_following_count, default: false
|
||||||
setting :hide_followers_count, default: false
|
setting :hide_followers_count, default: false
|
||||||
|
|
|
@ -96,6 +96,14 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer
|
||||||
end
|
end
|
||||||
|
|
||||||
def discoverable
|
def discoverable
|
||||||
|
if object.local?
|
||||||
|
object.user&.setting_discoverable_local ? false : original_discoverable
|
||||||
|
else
|
||||||
|
original_discoverable
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def original_discoverable
|
||||||
object.suspended? ? false : (object.discoverable || false)
|
object.suspended? ? false : (object.discoverable || false)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,11 @@ class UpdateAccountService < BaseService
|
||||||
params.delete(:bio_markdown)
|
params.delete(:bio_markdown)
|
||||||
account.user.send(update_method, user_params)
|
account.user.send(update_method, user_params)
|
||||||
end
|
end
|
||||||
|
if account.user && params.key?(:discoverable_local)
|
||||||
|
user_params = { settings_attributes: { discoverable_local: params['discoverable_local'] } }
|
||||||
|
params.delete(:discoverable_local)
|
||||||
|
account.user.send(update_method, user_params)
|
||||||
|
end
|
||||||
|
|
||||||
account.send(update_method, params).tap do |ret|
|
account.send(update_method, params).tap do |ret|
|
||||||
next unless ret
|
next unless ret
|
||||||
|
|
|
@ -64,6 +64,10 @@
|
||||||
.fields-group
|
.fields-group
|
||||||
= f.input :discoverable, as: :boolean, wrapper: :with_label, hint: t('simple_form.hints.defaults.discoverable'), recommended: true
|
= f.input :discoverable, as: :boolean, wrapper: :with_label, hint: t('simple_form.hints.defaults.discoverable'), recommended: true
|
||||||
|
|
||||||
|
= f.simple_fields_for :settings, current_user.settings do |ff|
|
||||||
|
.fields-group
|
||||||
|
= ff.input :discoverable_local, input_html: { name: 'account[discoverable_local]' }, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.discoverable_local'), hint: I18n.t('simple_form.hints.defaults.discoverable_local')
|
||||||
|
|
||||||
.fields-group
|
.fields-group
|
||||||
= f.input :locked, as: :boolean, wrapper: :with_label, hint: t('simple_form.hints.defaults.locked')
|
= f.input :locked, as: :boolean, wrapper: :with_label, hint: t('simple_form.hints.defaults.locked')
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@ ja:
|
||||||
current_username: 確認のため、現在のアカウントのユーザー名を入力してください
|
current_username: 確認のため、現在のアカウントのユーザー名を入力してください
|
||||||
digest: 長期間使用していない場合と不在時に返信を受けた場合のみ送信されます
|
digest: 長期間使用していない場合と不在時に返信を受けた場合のみ送信されます
|
||||||
discoverable: レコメンド、トレンド、その他の機能により、あなたのアカウントを他の人から見つけられるようにします
|
discoverable: レコメンド、トレンド、その他の機能により、あなたのアカウントを他の人から見つけられるようにします
|
||||||
|
discoverable_local: 上記設定を当サーバー内でのみ適用するようにします
|
||||||
dissubscribable: あなたの投稿はすべてのアンテナに掲載されなくなります。Misskeyのアンテナを拒否することはできません。Mastodonの一部のサーバーもこの設定に対応しますが、挙動が一部kmyblueと異なる場合があります
|
dissubscribable: あなたの投稿はすべてのアンテナに掲載されなくなります。Misskeyのアンテナを拒否することはできません。Mastodonの一部のサーバーもこの設定に対応しますが、挙動が一部kmyblueと異なる場合があります
|
||||||
email: 確認のメールが送信されます
|
email: 確認のメールが送信されます
|
||||||
group: このアカウントに送られたメンションは自動でBTされ、フォローしている全てのアカウントに配信されます
|
group: このアカウントに送られたメンションは自動でBTされ、フォローしている全てのアカウントに配信されます
|
||||||
|
@ -192,6 +193,7 @@ ja:
|
||||||
current_password: 現在のパスワード
|
current_password: 現在のパスワード
|
||||||
data: データ
|
data: データ
|
||||||
discoverable: ディレクトリに掲載する
|
discoverable: ディレクトリに掲載する
|
||||||
|
discoverable_local: 他サーバーのディレクトリに掲載しない
|
||||||
display_name: 表示名
|
display_name: 表示名
|
||||||
dissubscribable: 購読を拒否する
|
dissubscribable: 購読を拒否する
|
||||||
email: メールアドレス
|
email: メールアドレス
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue