FIX: don't trigger topic_created event for reply posts via email. (#15485)

Previously, we incorrectly triggered `topic_created` events when the posts are created via email since we didn't check the post number.
This commit is contained in:
Vinoth Kannan
2022-01-10 13:54:10 +05:30
committed by GitHub
parent f99ade3ce5
commit f614b30032
2 changed files with 10 additions and 2 deletions

View File

@ -1308,7 +1308,7 @@ module Email
import_mode: options[:import_mode],
post_alert_options: options[:post_alert_options]
).enqueue_jobs
DiscourseEvent.trigger(:topic_created, result.post.topic, options, user)
DiscourseEvent.trigger(:topic_created, result.post.topic, options, user) if result.post.is_first_post?
DiscourseEvent.trigger(:post_created, result.post, options, user)
end