diff --git a/modules/report/report.js b/modules/report/report.js index 2f29b0b..d813a24 100644 --- a/modules/report/report.js +++ b/modules/report/report.js @@ -35,10 +35,10 @@ console.log('sending msg to ' + nick); message = message.replace(/(#[\w\-]+)/g, '\u000312$1\u000f'); - _.each(message.match(/ @([\d\w*|-]+)/g), function(u) { - u = u.substr(1); + _.each(_.union(message.match(/ @([\d\w*|-]+)/g), message.match(/([\d\w*|-]+)@ ?/g)), function(u) { + u = u.replace(/\s|@/g/, ''); message = message.replace(u, colours['nicks'] + u + "\u000f"); - notifier += '[' + colours['nicks'] + u.substr(1) + '\u000f]'; + notifier += '[' + colours['nicks'] + u + '\u000f]'; }); }