mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 03:06:53 +08:00
FIX: post & topic destroyed hooks not triggering with tag filter
This commit is contained in:
@ -61,19 +61,11 @@ class PostDestroyer
|
||||
mark_for_deletion(delete_removed_posts_after)
|
||||
end
|
||||
DiscourseEvent.trigger(:post_destroyed, @post, @opts, @user)
|
||||
WebHook.enqueue_hooks(:post, :post_destroyed,
|
||||
id: @post.id,
|
||||
category_id: @post&.topic&.category_id,
|
||||
payload: payload
|
||||
) if WebHook.active_web_hooks(:post).exists?
|
||||
WebHook.enqueue_post_hooks(:post_destroyed, @post, payload)
|
||||
|
||||
if @post.is_first_post? && @post.topic
|
||||
DiscourseEvent.trigger(:topic_destroyed, @post.topic, @user)
|
||||
WebHook.enqueue_hooks(:topic, :topic_destroyed,
|
||||
id: topic.id,
|
||||
category_id: topic&.category_id,
|
||||
payload: topic_payload
|
||||
) if WebHook.active_web_hooks(:topic).exists?
|
||||
WebHook.enqueue_topic_hooks(:topic_destroyed, @post.topic, topic_payload)
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user