2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-04 08:47:37 +08:00

Don't enqueue topic webhook unless a post has a topic

This commit is contained in:
scossar 2018-01-22 11:58:01 -08:00 committed by Guo Xiang Tan
parent 7bcc0c1da9
commit 9d0807224b
2 changed files with 26 additions and 3 deletions

View file

@ -18,8 +18,13 @@ end
end
DiscourseEvent.on(:post_edited) do |post, topic_changed|
WebHook.enqueue_post_hooks(:post_edited, post)
WebHook.enqueue_topic_hooks(:topic_edited, post.topic) if post.is_first_post? && topic_changed
if post.topic
WebHook.enqueue_post_hooks(:post_edited, post)
if post.is_first_post? && topic_changed
WebHook.enqueue_topic_hooks(:topic_edited, post.topic)
end
end
end
%i(