New users can only post newuser_max_replies_per_topic times per topic.

This commit is contained in:
Robin Ward
2013-12-19 13:45:55 -05:00
parent 39e711783d
commit 1cac9fa257
8 changed files with 68 additions and 1 deletions

View File

@ -7,6 +7,7 @@ class ComposerMessagesFinder
def find
check_education_message ||
check_new_user_many_replies ||
check_avatar_notification ||
check_sequential_replies ||
check_dominating_topic
@ -32,6 +33,12 @@ class ComposerMessagesFinder
nil
end
# New users have a limited number of replies in a topic
def check_new_user_many_replies
return unless replying? && @user.posted_too_much_in_topic?(@details[:topic_id])
{templateName: 'composer/education', body: PrettyText.cook(I18n.t('education.too_many_replies', newuser_max_replies_per_topic: SiteSetting.newuser_max_replies_per_topic)) }
end
# Should a user be contacted to update their avatar?
def check_avatar_notification