FIX: only show the sequential replies warning for regular posts

This commit is contained in:
Régis Hanol 2018-07-04 22:51:19 +02:00
parent 8a53941fe0
commit 272646c1df
2 changed files with 3 additions and 1 deletions

View File

@ -84,9 +84,10 @@ class ComposerMessagesFinder
def check_sequential_replies
return unless educate_reply?(:notified_about_sequential_replies)
# Count the topics made by this user in the last day
# Count the posts made by this user in the last day
recent_posts_user_ids = Post.where(topic_id: @details[:topic_id])
.where("created_at > ?", 1.day.ago)
.where(post_type: Post.types[:regular])
.order('created_at desc')
.limit(SiteSetting.sequential_replies_threshold)
.pluck(:user_id)

View File

@ -157,6 +157,7 @@ describe ComposerMessagesFinder do
Fabricate(:post, topic: topic, user: user)
Fabricate(:post, topic: topic, user: user)
Fabricate(:post, topic: topic, user: user, post_type: Post.types[:small_action])
SiteSetting.sequential_replies_threshold = 2
end