mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
NewPostManager
determines whether to queue a post or not
This commit is contained in:
@ -134,6 +134,8 @@ class PostCreator
|
||||
track_latest_on_category
|
||||
enqueue_jobs
|
||||
BadgeGranter.queue_badge_grant(Badge::Trigger::PostRevision, post: @post)
|
||||
|
||||
trigger_after_events(@post)
|
||||
end
|
||||
|
||||
if @post || @spam
|
||||
@ -169,6 +171,11 @@ class PostCreator
|
||||
|
||||
protected
|
||||
|
||||
def trigger_after_events(post)
|
||||
DiscourseEvent.trigger(:topic_created, post.topic, @opts, @user) unless @opts[:topic_id]
|
||||
DiscourseEvent.trigger(:post_created, post, @opts, @user)
|
||||
end
|
||||
|
||||
def transaction(&blk)
|
||||
Post.transaction do
|
||||
if new_topic?
|
||||
|
Reference in New Issue
Block a user