mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
BUGFIX: New status posts weren't using PostCreator
This commit is contained in:
@@ -322,12 +322,16 @@ class Topic < ActiveRecord::Base
|
||||
def add_moderator_post(user, text, opts={})
|
||||
new_post = nil
|
||||
Topic.transaction do
|
||||
new_post = posts.create(user: user, raw: text, post_type: Post.types[:moderator_action], no_bump: opts[:bump].blank?)
|
||||
creator = PostCreator.new(user,
|
||||
raw: text,
|
||||
post_type: Post.types[:moderator_action],
|
||||
no_bump: opts[:bump].blank?,
|
||||
topic_id: self.id)
|
||||
new_post = creator.create
|
||||
increment!(:moderator_posts_count)
|
||||
new_post
|
||||
end
|
||||
|
||||
|
||||
if new_post.present?
|
||||
# If we are moving posts, we want to insert the moderator post where the previous posts were
|
||||
# in the stream, not at the end.
|
||||
|
||||
Reference in New Issue
Block a user