Merge branch 'main' into glitch-soc/merge-upstream

This commit is contained in:
Claire
2022-02-12 11:12:41 +01:00
18 changed files with 112 additions and 13 deletions

View File

@@ -34,6 +34,7 @@ class FanOutOnWriteService < BaseService
def fan_out_to_local_recipients!
deliver_to_self!
notify_mentioned_accounts!
notify_about_update! if update?
case @status.visibility.to_sym
when :public, :unlisted, :private
@@ -66,6 +67,14 @@ class FanOutOnWriteService < BaseService
end
end
def notify_about_update!
@status.reblogged_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
end
end
def deliver_to_all_followers!
@account.followers_for_local_distribution.select(:id).reorder(nil).find_in_batches do |followers|
FeedInsertWorker.push_bulk(followers) do |follower|