mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 04:01:18 +08:00
DEV: Add :push_notification event and deprecate :post_notification_alert (#22917)
This commit introduces the :push_notification event and deprecates :post_notification_alert. The old :post_notification_alert event was not triggered when pushing chat notifications and did not respect when the user was in "do not disturb" mode. The new event fixes these issues.
This commit is contained in:
@ -13,13 +13,23 @@ class DiscourseEvent
|
||||
end
|
||||
|
||||
def self.on(event_name, &block)
|
||||
if event_name == :user_badge_removed
|
||||
case event_name
|
||||
when :user_badge_removed
|
||||
Discourse.deprecate(
|
||||
"The :user_badge_removed event is deprecated. Please use :user_badge_revoked instead",
|
||||
since: "3.1.0.beta5",
|
||||
drop_from: "3.2.0.beta1",
|
||||
output_in_test: true,
|
||||
)
|
||||
when :post_notification_alert
|
||||
Discourse.deprecate(
|
||||
"The :post_notification_alert event is deprecated. Please use :push_notification instead",
|
||||
since: "3.2.0.beta1",
|
||||
drop_from: "3.3.0.beta1",
|
||||
output_in_test: true,
|
||||
)
|
||||
else
|
||||
# ignore
|
||||
end
|
||||
|
||||
events[event_name] << block
|
||||
|
Reference in New Issue
Block a user