Don't employ the "too many replies" if the user is staff, or if they created the topic.

See: http://meta.discourse.org/t/what-is-the-point-of-limiting-new-users-to-three-replies-per-topic/11696
This commit is contained in:
Robin Ward
2014-01-02 12:57:40 -05:00
parent aefad6ae85
commit f145060315
2 changed files with 34 additions and 0 deletions

View File

@@ -354,6 +354,10 @@ class User < ActiveRecord::Base
end
def posted_too_much_in_topic?(topic_id)
# Does not apply to staff or your own topics
return false if staff? || Topic.where(id: topic_id, user_id: id).exists?
trust_level == TrustLevel.levels[:newuser] && (Post.where(topic_id: topic_id, user_id: id).count >= SiteSetting.newuser_max_replies_per_topic)
end