Fix accpeted quotes sometimes not generating notifications (#36087)

This commit is contained in:
Claire 2025-09-11 14:58:25 +02:00 committed by GitHub
parent aacc829dc6
commit e35dfbfdef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 7 deletions

View File

@ -33,6 +33,9 @@ class ActivityPub::Activity::QuoteRequest < ActivityPub::Activity
json = Oj.dump(serialize_payload(status.quote, ActivityPub::AcceptQuoteRequestSerializer)) json = Oj.dump(serialize_payload(status.quote, ActivityPub::AcceptQuoteRequestSerializer))
ActivityPub::DeliveryWorker.perform_async(json, quoted_status.account_id, @account.inbox_url) ActivityPub::DeliveryWorker.perform_async(json, quoted_status.account_id, @account.inbox_url)
# Ensure the user is notified
LocalNotificationWorker.perform_async(quoted_status.account_id, status.quote.id, 'Quote', 'quote')
end end
def import_instrument(quoted_status) def import_instrument(quoted_status)

View File

@ -40,7 +40,6 @@ class FanOutOnWriteService < BaseService
deliver_to_self! deliver_to_self!
unless @options[:skip_notifications] unless @options[:skip_notifications]
notify_quoted_account!
notify_mentioned_accounts! notify_mentioned_accounts!
notify_about_update! if update? notify_about_update! if update?
end end
@ -70,12 +69,6 @@ class FanOutOnWriteService < BaseService
FeedManager.instance.push_to_home(@account, @status, update: update?) if @account.local? FeedManager.instance.push_to_home(@account, @status, update: update?) if @account.local?
end end
def notify_quoted_account!
return unless @status.quote&.quoted_account&.local? && @status.quote&.accepted?
LocalNotificationWorker.perform_async(@status.quote.quoted_account_id, @status.quote.id, 'Quote', 'quote')
end
def notify_mentioned_accounts! def notify_mentioned_accounts!
@status.active_mentions.where.not(id: @options[:silenced_account_ids] || []).joins(:account).merge(Account.local).select(:id, :account_id).reorder(nil).find_in_batches do |mentions| @status.active_mentions.where.not(id: @options[:silenced_account_ids] || []).joins(:account).merge(Account.local).select(:id, :account_id).reorder(nil).find_in_batches do |mentions|
LocalNotificationWorker.push_bulk(mentions) do |mention| LocalNotificationWorker.push_bulk(mentions) do |mention|