Merge commit '752d49eefef48262d501ba5fc2006d2c8466a000' into glitch-soc/merge-upstream

Conflicts:
- `app/lib/feed_manager.rb`:
  Upstream changed how notifications from follow subscriptions were handled,
  refactoring this file in the process.
  Conflict is due to glitch-soc having an extra timeline type (direct).
  Ported upstream's changes.
- `app/workers/feed_insert_worker.rb`:
  Ditto.
This commit is contained in:
Claire
2024-12-02 21:08:15 +01:00
133 changed files with 595 additions and 580 deletions

View File

@@ -31,29 +31,33 @@ class FeedInsertWorker
private
def check_and_insert
if feed_filtered?
filter_result = feed_filter
if filter_result
perform_unpush if update?
else
perform_push
perform_notify if notify?
end
perform_notify if notify?(filter_result)
end
def feed_filtered?
def feed_filter
case @type
when :home
FeedManager.instance.filter?(:home, @status, @follower)
FeedManager.instance.filter(:home, @status, @follower)
when :tags
FeedManager.instance.filter?(:tags, @status, @follower)
FeedManager.instance.filter(:tags, @status, @follower)
when :list
FeedManager.instance.filter?(:list, @status, @list)
FeedManager.instance.filter(:list, @status, @list)
when :direct
FeedManager.instance.filter?(:direct, @status, @account)
FeedManager.instance.filter(:direct, @status, @account)
end
end
def notify?
return false if @type != :home || @status.reblog? || (@status.reply? && @status.in_reply_to_account_id != @status.account_id)
def notify?(filter_result)
return false if @type != :home || @status.reblog? || (@status.reply? && @status.in_reply_to_account_id != @status.account_id) ||
filter_result == :filter
Follow.find_by(account: @follower, target_account: @status.account)&.notify?
end