Fix: #241 リスト新着通知で、数日前の古い投稿についての通知が来る場合がある (#242)

* Fix: #241 リスト通知の重複についてとりあえずの対処

* Fix: 本家の通知バグ
This commit is contained in:
KMY(雪あすか) 2023-11-07 17:16:10 +09:00 committed by GitHub
parent 59f851d21a
commit d7f07ae80f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View file

@ -10,6 +10,7 @@ class FeedInsertWorker
@status = Status.find(status_id)
@options = options.symbolize_keys
@antenna = Antenna.find(@options[:antenna_id]) if @options[:antenna_id].present?
@pushed = false
case @type
when :home, :tags
@ -60,7 +61,7 @@ class FeedInsertWorker
end
def notify_for_list?
return false unless @type == :list
return false if @type != :list || update? || !@pushed
@list.notify?
end
@ -69,9 +70,9 @@ class FeedInsertWorker
if @antenna.nil? || @antenna.insert_feeds
case @type
when :home, :tags
FeedManager.instance.push_to_home(@follower, @status, update: update?)
@pushed = FeedManager.instance.push_to_home(@follower, @status, update: update?)
when :list
FeedManager.instance.push_to_list(@list, @status, update: update?)
@pushed = FeedManager.instance.push_to_list(@list, @status, update: update?)
end
end