diff --git a/app/controllers/tag_controller.rb b/app/controllers/tag_controller.rb index 826ed71dc3..e484670ef2 100644 --- a/app/controllers/tag_controller.rb +++ b/app/controllers/tag_controller.rb @@ -255,6 +255,15 @@ def create @output[:errors] << I18n.t('tag_controller.tag_already_exists') elsif node.can_tag(tagname, current_user) === true || current_user.role == 'admin' # || current_user.role == "moderator" saved, tag = node.add_tag(tagname.strip, current_user) + if tagname.split(':')[0] == "barnstar" + CommentMailer.notify_barnstar(current_user, node) + barnstar_info_link = 'barnstar' + node.add_comment(subject: 'barnstar', + uid: current_user.uid, + body: "@#{current_user.username} awards a #{barnstar_info_link} to #{node.drupal_user.name} for their awesome contribution!") + + end + if saved @tags << tag @output[:saved] << [tag.name, tag.id]