mirror of
https://github.com/discourse/discourse.git
synced 2025-03-06 11:19:51 +00:00
FIX: only show the sequential replies warning for regular posts
This commit is contained in:
parent
8a53941fe0
commit
272646c1df
@ -84,9 +84,10 @@ class ComposerMessagesFinder
|
|||||||
def check_sequential_replies
|
def check_sequential_replies
|
||||||
return unless educate_reply?(:notified_about_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])
|
recent_posts_user_ids = Post.where(topic_id: @details[:topic_id])
|
||||||
.where("created_at > ?", 1.day.ago)
|
.where("created_at > ?", 1.day.ago)
|
||||||
|
.where(post_type: Post.types[:regular])
|
||||||
.order('created_at desc')
|
.order('created_at desc')
|
||||||
.limit(SiteSetting.sequential_replies_threshold)
|
.limit(SiteSetting.sequential_replies_threshold)
|
||||||
.pluck(:user_id)
|
.pluck(:user_id)
|
||||||
|
@ -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)
|
Fabricate(:post, topic: topic, user: user)
|
||||||
|
Fabricate(:post, topic: topic, user: user, post_type: Post.types[:small_action])
|
||||||
|
|
||||||
SiteSetting.sequential_replies_threshold = 2
|
SiteSetting.sequential_replies_threshold = 2
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user