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|

View File

@ -46,6 +46,10 @@ class NotifyService < BaseService
false
end
def blocked_update?
false
end
def following_sender?
return @following_sender if defined?(@following_sender)
@following_sender = @recipient.following?(@notification.from_account) || @recipient.requested?(@notification.from_account)