FEATURE: Skip small actions when counting replies in PMs. (#7108)

This commit is contained in:
Dan Ungureanu
2019-03-08 10:49:34 +02:00
committed by GitHub
parent 35942f7c7c
commit 2312caccdc
3 changed files with 81 additions and 9 deletions

View File

@ -248,7 +248,11 @@ class PostCreator
post.word_count = post.raw.scan(/[[:word:]]+/).size
whisper = post.post_type == Post.types[:whisper]
post.post_number ||= Topic.next_post_number(post.topic_id, post.reply_to_post_number.present?, whisper)
increase_posts_count = !post.topic&.private_message? || post.post_type != Post.types[:small_action]
post.post_number ||= Topic.next_post_number(post.topic_id,
reply: post.reply_to_post_number.present?,
whisper: whisper,
post: increase_posts_count)
cooking_options = post.cooking_options || {}
cooking_options[:topic_id] = post.topic_id