* Wip: マイグレーション、設定など一式 * Fix test * Fix test * Fix: マスター用の設定を他サーバーに送信しないよう修正 * DTL、外部サーバーの情報受け入れのテストを追加 * スペルミスを修正 * Web画面に設定項目追加 * 既存の`master_settings`を上書きしないよう修正
This commit is contained in:
parent
a7dec3c59b
commit
76f2f2ed0c
26 changed files with 284 additions and 52 deletions
|
@ -83,7 +83,6 @@ class ActivityPub::ProcessAccountService < BaseService
|
|||
@account.suspension_origin = :local if auto_suspend?
|
||||
@account.silenced_at = domain_block.created_at if auto_silence?
|
||||
@account.searchability = :direct # not null
|
||||
@account.dissubscribable = false # not null
|
||||
|
||||
set_immediate_protocol_attributes!
|
||||
|
||||
|
@ -125,8 +124,8 @@ class ActivityPub::ProcessAccountService < BaseService
|
|||
@account.discoverable = @json['discoverable'] || false
|
||||
@account.indexable = @json['indexable'] || false
|
||||
@account.searchability = searchability_from_audience
|
||||
@account.dissubscribable = !subscribable(@account.note)
|
||||
@account.settings = other_settings
|
||||
@account.master_settings = (@account.master_settings || {}).merge(master_settings(@account.note))
|
||||
@account.memorial = @json['memorial'] || false
|
||||
end
|
||||
|
||||
|
@ -320,14 +319,24 @@ class ActivityPub::ProcessAccountService < BaseService
|
|||
@subscribable_by = as_array(@json['subscribableBy']).map { |x| value_or_id(x) }
|
||||
end
|
||||
|
||||
def subscribable(note)
|
||||
def subscription_policy(note)
|
||||
if subscribable_by.nil?
|
||||
note.exclude?('[subscribable:no]')
|
||||
note.include?('[subscribable:no]') ? :block : :allow
|
||||
elsif subscribable_by.any? { |uri| ActivityPub::TagManager.instance.public_collection?(uri) }
|
||||
:allow
|
||||
elsif subscribable_by.include?(@account.followers_url)
|
||||
:followers_only
|
||||
else
|
||||
subscribable_by.any? { |uri| ActivityPub::TagManager.instance.public_collection?(uri) }
|
||||
:block
|
||||
end
|
||||
end
|
||||
|
||||
def master_settings(note)
|
||||
{
|
||||
'subscription_policy' => subscription_policy(note),
|
||||
}
|
||||
end
|
||||
|
||||
def other_settings
|
||||
return {} unless @json['otherSetting'].is_a?(Array)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue