diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2022-02-11 22:20:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-11 22:20:19 +0100 |
commit | 8f03b7a2fb4b420eb46942157160816185e81751 (patch) | |
tree | 125819d272db5626bbd41406c633ef39ccd334da /app/services | |
parent | d0fcf07436d158bcac2617d076a83d0aa49c39e6 (diff) |
Add notifications when a reblogged status has been updated (#17404)
* Add notifications when a reblogged status has been updated * Change wording to say "edit" instead of "update" and add missing controls * Replace previous update notifications with the most up-to-date one
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/fan_out_on_write_service.rb | 9 | ||||
-rw-r--r-- | app/services/notify_service.rb | 4 |
2 files changed, 13 insertions, 0 deletions
diff --git a/app/services/fan_out_on_write_service.rb b/app/services/fan_out_on_write_service.rb index 4f847e293..2bab91116 100644 --- a/app/services/fan_out_on_write_service.rb +++ b/app/services/fan_out_on_write_service.rb @@ -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 @@ -64,6 +65,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| diff --git a/app/services/notify_service.rb b/app/services/notify_service.rb index 0f3516d28..039e007f5 100644 --- a/app/services/notify_service.rb +++ b/app/services/notify_service.rb @@ -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) |