Add in-app notifications for moderation actions/warnings (#30065)

This commit is contained in:
Claire 2024-04-25 19:26:05 +02:00 committed by GitHub
parent 0ec061aa8f
commit 4ef0b48b95
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 188 additions and 21 deletions

View file

@ -9,6 +9,7 @@ class NotifyService < BaseService
update
poll
status
moderation_warning
# TODO: this probably warrants an email notification
severed_relationships
).freeze
@ -22,7 +23,7 @@ class NotifyService < BaseService
def dismiss?
blocked = @recipient.unavailable?
blocked ||= from_self? && @notification.type != :poll && @notification.type != :severed_relationships
blocked ||= from_self? && %i(poll severed_relationships moderation_warning).exclude?(@notification.type)
return blocked if message? && from_staff?
@ -75,6 +76,7 @@ class NotifyService < BaseService
admin.report
poll
update
account_warning
).freeze
def initialize(notification)