1
0
Fork 0
forked from gitea/nas

Add: #95 リストへの新着投稿通知 (#192)

* Add: テーブル定義、内部処理

* Add: 通知の定期削除処理、自動削除、テスト

* Add: Web画面の表示、設定

* Fix test
This commit is contained in:
KMY(雪あすか) 2023-10-31 08:59:31 +09:00 committed by GitHub
parent 2cc60253c4
commit f8280ca5d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 300 additions and 9 deletions

View file

@ -38,6 +38,7 @@ class FeedInsertWorker
else
perform_push
perform_notify if notify?
perform_notify_for_list if notify_for_list?
end
end
@ -58,6 +59,12 @@ class FeedInsertWorker
Follow.find_by(account: @follower, target_account: @status.account)&.notify?
end
def notify_for_list?
return false unless @type == :list
@list.notify?
end
def perform_push
if @antenna.nil? || @antenna.insert_feeds
case @type
@ -90,6 +97,11 @@ class FeedInsertWorker
LocalNotificationWorker.perform_async(@follower.id, @status.id, 'Status', 'status')
end
def perform_notify_for_list
list_status = ListStatus.create!(list: @list, status: @status)
LocalNotificationWorker.perform_async(@list.account_id, list_status.id, 'ListStatus', 'list_status')
end
def update?
@options[:update]
end