Merge remote-tracking branch 'parent/main' into upstream-20250210

This commit is contained in:
KMY 2025-02-17 08:57:56 +09:00
commit 935bea989d
69 changed files with 1646 additions and 1363 deletions

View file

@ -296,7 +296,7 @@ class ActivityPub::ProcessStatusUpdateService < BaseService
nil
end
@status.mentions.upsert_all(currently_mentioned_account_ids.map { |id| { account_id: id, silent: false } }, unique_by: %w(status_id account_id))
@status.mentions.upsert_all(currently_mentioned_account_ids.uniq.map { |id| { account_id: id, silent: false } }, unique_by: %w(status_id account_id))
# If previous mentions are no longer contained in the text, convert them
# to silent mentions, since withdrawing access from someone who already

View file

@ -50,10 +50,14 @@ class BlockDomainService < BaseService
def notify_of_severed_relationships!
return if @domain_block_event.nil?
# TODO: check how efficient that query is, also check `push_bulk`/`perform_bulk`
@domain_block_event.affected_local_accounts.reorder(nil).find_each do |account|
event = AccountRelationshipSeveranceEvent.create!(account: account, relationship_severance_event: @domain_block_event)
LocalNotificationWorker.perform_async(account.id, event.id, 'AccountRelationshipSeveranceEvent', 'severed_relationships')
# find_in_batches and perform_bulk both default to batches of 1000
@domain_block_event.affected_local_accounts.reorder(nil).find_in_batches do |accounts|
notification_jobs_args = accounts.map do |account|
event = AccountRelationshipSeveranceEvent.create!(account:, relationship_severance_event: @domain_block_event)
[account.id, event.id, 'AccountRelationshipSeveranceEvent', 'severed_relationships']
end
LocalNotificationWorker.perform_bulk(notification_jobs_args)
end
end