* Change: サークルの送り先アカウント指定方法を`account_username`(Fedibirdと同様)に変更 (#283) * Change: サークルの送り先アカウント指定方法を`account_username`(Fedibirdと同様)に変更 * Test: テストを追加 * Maybe Fix: Fedibirdで自分限定と認識される問題 * Fix test
This commit is contained in:
parent
203617edaf
commit
8383288219
4 changed files with 47 additions and 6 deletions
|
@ -119,10 +119,7 @@ class ActivityPub::TagManager
|
|||
end.compact
|
||||
end
|
||||
when 'limited'
|
||||
status.mentions.each_with_object([]) do |mention, result|
|
||||
result << uri_for(mention.account)
|
||||
result << followers_uri_for(mention.account) if mention.account.group?
|
||||
end.compact
|
||||
['kmyblue:Limited'] # to avoid Fedibird personal visibility
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -21,6 +21,12 @@ class StatusReachFinder
|
|||
end
|
||||
end
|
||||
|
||||
def inboxes_for_limited
|
||||
DeliveryFailureTracker.without_unavailable(
|
||||
@status.mentioned_accounts.where.not(domain: nil).pluck(:inbox_url).compact.uniq
|
||||
)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def reached_account_inboxes
|
||||
|
|
|
@ -7,13 +7,23 @@ class ActivityPub::DistributionWorker < ActivityPub::RawDistributionWorker
|
|||
@status = Status.find(status_id)
|
||||
@account = @status.account
|
||||
|
||||
distribute!
|
||||
if @status.limited_visibility?
|
||||
distribute_limited!
|
||||
else
|
||||
distribute!
|
||||
end
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
true
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def distribute_limited!
|
||||
ActivityPub::DeliveryWorker.push_bulk(inboxes_for_limited, limit: 1_000) do |inbox_url|
|
||||
[payload, @account.id, inbox_url, options]
|
||||
end
|
||||
end
|
||||
|
||||
def inboxes
|
||||
@inboxes ||= status_reach_finder.inboxes
|
||||
end
|
||||
|
@ -22,6 +32,10 @@ class ActivityPub::DistributionWorker < ActivityPub::RawDistributionWorker
|
|||
@inboxes_for_misskey ||= status_reach_finder.inboxes_for_misskey
|
||||
end
|
||||
|
||||
def inboxes_for_limited
|
||||
@inboxes_for_limited ||= status_reach_finder.inboxes_for_limited
|
||||
end
|
||||
|
||||
def status_reach_finder
|
||||
@status_reach_finder ||= StatusReachFinder.new(@status)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue