When system flags users as sockpuppets, show a reason in the admin flags ui

This commit is contained in:
Neil Lalonde
2013-10-16 11:47:01 -04:00
parent debd9bfb25
commit c7aaee907b
4 changed files with 14 additions and 4 deletions

View File

@@ -40,9 +40,9 @@ class SpamRulesEnforcer
def flag_sockpuppet_users
system_user = Discourse.system_user
PostAction.act(system_user, @post, PostActionType.types[:spam]) rescue PostAction::AlreadyActed
PostAction.act(system_user, @post, PostActionType.types[:spam], message: I18n.t('flag_reason.sockpuppet')) rescue PostAction::AlreadyActed
if (first_post = @post.topic.posts.by_post_number.first).try(:user).try(:new_user?)
PostAction.act(system_user, first_post, PostActionType.types[:spam]) rescue PostAction::AlreadyActed
PostAction.act(system_user, first_post, PostActionType.types[:spam], message: I18n.t('flag_reason.sockpuppet')) rescue PostAction::AlreadyActed
end
end