mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 16:46:12 +08:00
Add event trigger for post notification alert.
This commit is contained in:
parent
904d9735ab
commit
9fc0b8607c
|
@ -341,7 +341,7 @@ class PostAlerter
|
|||
# we may have an invalid post somehow, dont blow up
|
||||
post_url = original_post.url rescue nil
|
||||
if post_url
|
||||
MessageBus.publish("/notification-alert/#{user.id}", {
|
||||
payload = {
|
||||
notification_type: type,
|
||||
post_number: original_post.post_number,
|
||||
topic_title: original_post.topic.title,
|
||||
|
@ -349,7 +349,10 @@ class PostAlerter
|
|||
excerpt: original_post.excerpt(400, text_entities: true, strip_links: true),
|
||||
username: original_username,
|
||||
post_url: post_url
|
||||
}, user_ids: [user.id])
|
||||
}
|
||||
|
||||
MessageBus.publish("/notification-alert/#{user.id}", payload, user_ids: [user.id])
|
||||
DiscourseEvent.trigger(:post_notification_alert, user, payload)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user