parent
89ef448d3a
commit
d789304e19
3 changed files with 37 additions and 2 deletions
|
@ -78,6 +78,7 @@ class Status < ApplicationRecord
|
|||
has_many :reblogs, foreign_key: 'reblog_of_id', class_name: 'Status', inverse_of: :reblog, dependent: :destroy
|
||||
has_many :reblogged_by_accounts, through: :reblogs, class_name: 'Account', source: :account
|
||||
has_many :quotes, foreign_key: 'quote_of_id', class_name: 'Status', inverse_of: :quote
|
||||
has_many :quoted_by_accounts, through: :quotes, class_name: 'Account', source: :account
|
||||
has_many :replies, foreign_key: 'in_reply_to_id', class_name: 'Status', inverse_of: :thread
|
||||
has_many :mentions, dependent: :destroy, inverse_of: :status
|
||||
has_many :mentioned_accounts, through: :mentions, source: :account, class_name: 'Account'
|
||||
|
|
|
@ -89,7 +89,7 @@ class FanOutOnWriteService < BaseService
|
|||
end
|
||||
|
||||
def notify_about_update!
|
||||
@status.reblogged_by_accounts.merge(Account.local).select(:id).reorder(nil).find_in_batches do |accounts|
|
||||
@status.reblogged_by_accounts.or(@status.quoted_by_accounts).merge(Account.local).select(:id).reorder(nil).find_in_batches do |accounts|
|
||||
LocalNotificationWorker.push_bulk(accounts) do |account|
|
||||
[account.id, @status.id, 'Status', 'update']
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue